mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Further work on new wake system. Wakes turn correctly but need to scale with velocity and
eventually desync with the boats. Needs to reset to the boats position on straights.
This commit is contained in:
@@ -4,11 +4,12 @@ import javafx.geometry.Point2D;
|
||||
import javafx.scene.Group;
|
||||
|
||||
/**
|
||||
* Created by CJIRWIN on 26/04/2017.
|
||||
* RaceObject defines the behaviour that animated objects whose position is updated from a yacht race data stream must
|
||||
* adhere to.
|
||||
*/
|
||||
public abstract class RaceObject extends Group {
|
||||
|
||||
//Time between sections of race - Should be changed to 200 for actual program.
|
||||
//Time between sections of race
|
||||
protected static double expectedUpdateInterval = 200;
|
||||
|
||||
protected double rotationalGoal;
|
||||
@@ -17,10 +18,6 @@ public abstract class RaceObject extends Group {
|
||||
protected double pixelVelocityX;
|
||||
protected double pixelVelocityY;
|
||||
|
||||
public boolean isSamePos (Point2D point) {
|
||||
return point.getX() == super.getLayoutX() && point.getY() == super.getLayoutY();
|
||||
}
|
||||
|
||||
public Point2D getPosition () {
|
||||
return new Point2D(super.getLayoutX(), getLayoutY());
|
||||
}
|
||||
@@ -45,6 +42,14 @@ public abstract class RaceObject extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the destination of everything within the RaceObject that has an ID in the array raceIds. The destination is
|
||||
* set to the co-ordinates (x, y) with the given rotation.
|
||||
* @param x
|
||||
* @param y
|
||||
* @param rotation
|
||||
* @param raceIds
|
||||
*/
|
||||
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