Game state now updates based on boat position. Arrows drawn as boat travels course. Currently do not point in correct direction, also the sparkline does not work.

#bug #refactor #implement #story[1118]
This commit is contained in:
Calum
2017-08-16 03:51:48 +12:00
parent 7329f7dc65
commit ac47e9d88a
51 changed files with 358 additions and 271 deletions
@@ -11,6 +11,7 @@ import javafx.scene.paint.Paint;
import javafx.scene.shape.Line;
import javafx.scene.shape.Polygon;
import javafx.scene.shape.Polyline;
import javafx.scene.shape.StrokeLineCap;
import javafx.scene.transform.Rotate;
/**
@@ -352,7 +353,8 @@ public class BoatObject extends Group {
BOAT_WIDTH / 1.75, BOAT_HEIGHT / 1.75
);
boatPoly.setStroke(Color.BLACK);
boatPoly.setStrokeWidth(3);
boatPoly.setStrokeWidth(2);
boatPoly.setStrokeLineCap(StrokeLineCap.ROUND);
isPlayer = true;
animateSail();
}
@@ -32,15 +32,29 @@ public class Marker extends Group {
public void constructArrows(MarkArrowFactory.RoundingSide roundingSide, double entryAngle, double exitAngle) {
enterArrow = MarkArrowFactory.constructEntryArrow(roundingSide, entryAngle, exitAngle, colour);
exitArrow = MarkArrowFactory.constructExitArrow(roundingSide, exitAngle, colour);
Platform.runLater(() -> this.getChildren().add(enterArrow));
// Platform.runLater(() -> this.getChildren().add(exitArrow));
}
public void showEnterArrow () {
Platform.runLater(() -> this.getChildren().setAll(enterArrow));
if (!this.getChildren().contains(enterArrow)) {
Platform.runLater(() -> {
this.getChildren().remove(exitArrow);
this.getChildren().add(enterArrow);
});
}
}
public void showExitArrow () {
Platform.runLater(() -> this.getChildren().setAll(exitArrow));
if (!this.getChildren().contains(exitArrow)) {
Platform.runLater(() -> {
this.getChildren().remove(enterArrow);
this.getChildren().add(exitArrow);
});
}
}
public void hideAllArows () {
Platform.runLater(() -> {
this.getChildren().removeAll(enterArrow, exitArrow);
});
}
}