Add riverboat captain career and distinct ship classes
Add class-specific vessel geometry and sea motion, a guided helm qualification path, dockside sailing orders, and local excursions at all 24 ports.
This commit is contained in:
@@ -65,12 +65,14 @@ namespace BigShipTycoon
|
||||
root.SetActive(false);
|
||||
}
|
||||
|
||||
internal void Update(Vector2 center, Vector2 bow, float speed, float length, float beam, float time, float storm)
|
||||
internal void Update(Vector2 center, Vector2 bow, float speed, float length, float beam, float time, float storm,
|
||||
bool sheltered = false)
|
||||
{
|
||||
Vector2 propellers = center - bow * (length * .476f);
|
||||
float thrust = Mathf.SmoothStep(0, 1, Mathf.InverseLerp(.9f, 14, speed));
|
||||
float thrust = Mathf.SmoothStep(0, 1, Mathf.InverseLerp(.9f, sheltered ? 9f : 14f, speed));
|
||||
var newest = new Station(propellers, bow, time, thrust);
|
||||
while (trail.Count > 0 && time - trail[0].Time > TrackAge)
|
||||
float trackAge = sheltered ? 15f : TrackAge;
|
||||
while (trail.Count > 0 && time - trail[0].Time > trackAge)
|
||||
trail.RemoveAt(0);
|
||||
|
||||
if (trail.Count == 0)
|
||||
@@ -95,7 +97,8 @@ namespace BigShipTycoon
|
||||
int row = 0;
|
||||
float distance = 0;
|
||||
Vector2 prior = propellers;
|
||||
WriteRow(row++, newest, time, 0, beam);
|
||||
float spread = sheltered ? .14f : .34f;
|
||||
WriteRow(row++, newest, time, 0, beam, spread);
|
||||
for (int i = trail.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Station sample = trail[i];
|
||||
@@ -103,7 +106,7 @@ namespace BigShipTycoon
|
||||
if (section < .19f)
|
||||
continue;
|
||||
distance += section;
|
||||
WriteRow(row++, sample, time, distance, beam);
|
||||
WriteRow(row++, sample, time, distance, beam, spread);
|
||||
prior = sample.Center;
|
||||
}
|
||||
if (distance < 1)
|
||||
@@ -136,10 +139,10 @@ namespace BigShipTycoon
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteRow(int row, Station station, float time, float distance, float beam)
|
||||
private void WriteRow(int row, Station station, float time, float distance, float beam, float spread)
|
||||
{
|
||||
float age = time - station.Time;
|
||||
float width = beam * .62f + distance * .34f;
|
||||
float width = beam * .62f + distance * spread;
|
||||
Vector2 right = new Vector2(-station.Forward.y, station.Forward.x);
|
||||
for (int col = 0; col < Columns; col++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user