Created separate listeners for all boats' and player boat health
#story[1291]
This commit is contained in:
@@ -334,9 +334,12 @@ public class RaceViewController extends Controller {
|
|||||||
|
|
||||||
boat.legProperty().addListener((o, prev, curr) -> Platform.runLater(() -> swapColours(curr)));
|
boat.legProperty().addListener((o, prev, curr) -> Platform.runLater(() -> swapColours(curr)));
|
||||||
boat.hasCollidedProperty().addListener((o, prev, curr) -> Platform.runLater(() -> showCollision(boat, shockwave)));
|
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()) {
|
if(boat.getSourceID() == race.getVisualiserRaceState().getPlayerBoatID()) {
|
||||||
boat.healthProperty().addListener((o, prev, curr) -> {
|
boat.healthProperty().addListener((o, prev, curr) -> {
|
||||||
System.out.println(curr);
|
System.out.println("Tomato: " + curr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user