mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Enabled boat path for only the player.
#story[987]
This commit is contained in:
@@ -111,7 +111,7 @@ public class BoatAnnotations extends Group{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVisible(boolean nameVisibility, boolean speedVisibility,
|
void setVisible(boolean nameVisibility, boolean speedVisibility,
|
||||||
boolean estTimeVisibility, boolean lastMarkVisibility) {
|
boolean estTimeVisibility, boolean lastMarkVisibility) {
|
||||||
int totalVisible = 0;
|
int totalVisible = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public class BoatGroup extends Group {
|
|||||||
private BoatAnnotations boatAnnotations;
|
private BoatAnnotations boatAnnotations;
|
||||||
private Color color;
|
private Color color;
|
||||||
private Boolean isSelected = true; //All boats are initialised as selected\
|
private Boolean isSelected = true; //All boats are initialised as selected\
|
||||||
|
private boolean isPlayer = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a BoatGroup with the default triangular boat polygon.
|
* Creates a BoatGroup with the default triangular boat polygon.
|
||||||
@@ -173,28 +174,27 @@ public class BoatGroup extends Group {
|
|||||||
if (framesToMove <= 0) {
|
if (framesToMove <= 0) {
|
||||||
isStopped = true;
|
isStopped = true;
|
||||||
}
|
}
|
||||||
|
if (distanceTravelled > 70 && isPlayer) {
|
||||||
|
distanceTravelled = 0d;
|
||||||
|
|
||||||
// if (distanceTravelled > 70) {
|
if (lastPoint != null) {
|
||||||
// distanceTravelled = 0d;
|
Line l = new Line(
|
||||||
//
|
lastPoint.getX(),
|
||||||
// if (lastPoint != null) {
|
lastPoint.getY(),
|
||||||
// Line l = new Line(
|
boatPoly.getLayoutX(),
|
||||||
// lastPoint.getX(),
|
boatPoly.getLayoutY()
|
||||||
// lastPoint.getY(),
|
);
|
||||||
// boatPoly.getLayoutX(),
|
l.getStrokeDashArray().setAll(3d, 7d);
|
||||||
// boatPoly.getLayoutY()
|
l.setStroke(boat.getColour());
|
||||||
// );
|
l.setCache(true);
|
||||||
// l.getStrokeDashArray().setAll(3d, 7d);
|
l.setCacheHint(CacheHint.SPEED);
|
||||||
// l.setStroke(boat.getColour());
|
lineGroup.getChildren().add(l);
|
||||||
// l.setCache(true);
|
}
|
||||||
// l.setCacheHint(CacheHint.SPEED);
|
|
||||||
// lineGroup.getChildren().add(l);
|
if (destinationSet) {
|
||||||
// }
|
lastPoint = new Point2D(boatPoly.getLayoutX(), boatPoly.getLayoutY());
|
||||||
//
|
}
|
||||||
// if (destinationSet) {
|
}
|
||||||
// lastPoint = new Point2D(boatPoly.getLayoutX(), boatPoly.getLayoutY());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// wake.updatePosition();
|
// wake.updatePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ public class BoatGroup extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setVisibility (boolean teamName, boolean velocity, boolean estTime, boolean legTime, boolean trail, boolean wake) {
|
public void setVisibility (boolean teamName, boolean velocity, boolean estTime, boolean legTime, boolean trail, boolean wake) {
|
||||||
boatAnnotations.setVisibile(teamName, velocity, estTime, legTime);
|
boatAnnotations.setVisible(teamName, velocity, estTime, legTime);
|
||||||
this.wake.setVisible(wake);
|
this.wake.setVisible(wake);
|
||||||
this.lineGroup.setVisible(trail);
|
this.lineGroup.setVisible(trail);
|
||||||
}
|
}
|
||||||
@@ -361,5 +361,6 @@ public class BoatGroup extends Group {
|
|||||||
boatPoly.setStroke(Color.BLACK);
|
boatPoly.setStroke(Color.BLACK);
|
||||||
boatPoly.setStrokeWidth(3);
|
boatPoly.setStrokeWidth(3);
|
||||||
boatAnnotations.setAsPlayer();
|
boatAnnotations.setAsPlayer();
|
||||||
|
isPlayer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user