mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
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:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user