Luffing sails animation working correctly, working on sailsin animation now.

#story[1111] #pair[kre39,ptg19]
This commit is contained in:
Kusal Ekanayake
2017-08-07 15:24:01 +12:00
parent ecf2c52cfa
commit c7857872ce
4 changed files with 29 additions and 10 deletions
@@ -81,6 +81,7 @@ public class GameView extends Pane {
private int frameTimeIndex = 0;
private boolean arrayFilled = false;
private Yacht playerYacht;
private double windDir = 0.0;
private enum ScaleDirection {
HORIZONTAL,
@@ -328,7 +329,7 @@ public class GameView extends Pane {
yacht.addLocationListener((boat, lat, lon, heading, velocity, sailIn) ->{
BoatObject bo = boatObjects.get(boat);
Point2D p2d = findScaledXY(lat, lon);
bo.moveTo(p2d.getX(), p2d.getY(), heading, velocity, sailIn, 95.0);
bo.moveTo(p2d.getX(), p2d.getY(), heading, velocity, sailIn, windDir);
// annotations.get(boat).setLayoutX(p2d.getX());
// annotations.get(boat).setLayoutY(p2d.getY());
// annotations.get(boat).setLocation(100d, 100d);
@@ -566,6 +567,12 @@ public class GameView extends Pane {
timer.stop();
}
public void setWindDir(double windDir) {
this.windDir = windDir;
}
public void startRace () {
timer.start();
}