mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Wakes still broken. Implemented dashed lines that track the progress of individual boats.
#implement #story[483]
This commit is contained in:
@@ -9,7 +9,7 @@ import javafx.scene.Group;
|
||||
public abstract class RaceObject extends Group {
|
||||
|
||||
//Time between sections of race - Should be changed to 200 for actual program.
|
||||
protected static double expectedUpdateInterval = 2000;
|
||||
protected static double expectedUpdateInterval = 200;
|
||||
|
||||
protected double rotationalGoal;
|
||||
protected double currentRotation;
|
||||
@@ -33,6 +33,18 @@ public abstract class RaceObject extends Group {
|
||||
RaceObject.expectedUpdateInterval = expectedUpdateInterval;
|
||||
}
|
||||
|
||||
protected void calculateRotationalVelocity () {
|
||||
if (Math.abs(rotationalGoal - currentRotation) > 180) {
|
||||
if (rotationalGoal - currentRotation >= 0) {
|
||||
this.rotationalVelocity = ((rotationalGoal - currentRotation) - 360) / expectedUpdateInterval;
|
||||
} else {
|
||||
this.rotationalVelocity = (360 + (rotationalGoal - currentRotation)) / expectedUpdateInterval;
|
||||
}
|
||||
} else {
|
||||
this.rotationalVelocity = (rotationalGoal - currentRotation) / expectedUpdateInterval;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void setDestination (double x, double y, double rotation, int... raceIds);
|
||||
|
||||
public abstract void setDestination (double x, double y, int... raceIds);
|
||||
|
||||
Reference in New Issue
Block a user