Created separate listeners for all boats' and player boat health

#story[1291]
main
Connor Taylor-Brown 8 years ago
parent 0d89574c1f
commit 23040ecff4

@ -334,9 +334,12 @@ public class RaceViewController extends Controller {
boat.legProperty().addListener((o, prev, curr) -> Platform.runLater(() -> swapColours(curr)));
boat.hasCollidedProperty().addListener((o, prev, curr) -> Platform.runLater(() -> showCollision(boat, shockwave)));
boat.healthProperty().addListener((o, prev, curr) -> {
System.out.println("Tab view: " + curr);
});
if(boat.getSourceID() == race.getVisualiserRaceState().getPlayerBoatID()) {
boat.healthProperty().addListener((o, prev, curr) -> {
System.out.println(curr);
System.out.println("Tomato: " + curr);
});
}
}

Loading…
Cancel
Save