On death a menu will pop up telling the user he is dead. #story[1292]

This commit is contained in:
zwu18
2017-09-27 01:09:03 +13:00
parent 1b8fa59f0e
commit 416eb1e6bf
2 changed files with 42 additions and 0 deletions
@@ -103,6 +103,8 @@ public class RaceViewController extends Controller {
private @FXML AnchorPane lineChartWrapper;
private @FXML GridPane playerHealthContainer;
private @FXML ImageView imageView;
private @FXML AnchorPane deathTransPane;
private @FXML StackPane deathPane;
/**
* Displays a specified race.
@@ -117,6 +119,8 @@ public class RaceViewController extends Controller {
this.controllerClient = controllerClient;
this.isHost = isHost;
keyFactory.load();
deathPane.setDisable(false);
deathPane.setVisible(false);
tutorialCheck();
initKeypressHandler();
initialiseRaceVisuals();
@@ -694,6 +698,16 @@ public class RaceViewController extends Controller {
if (raceState.getRaceStatusEnum() == RaceStatusEnum.FINISHED) {
stop(); // stop the timer
} else {
try {
if(raceState.getBoat(raceState.getPlayerBoatID()).getHealth()<=0){
if(!deathPane.isDisable()) {
deathPane.setVisible(true);
}
}
} catch (BoatNotFoundException e) {
e.printStackTrace();
}
for(VisualiserBoat boat : raceState.getBoats()){
for (HealthEffect fp : healthEffectList){
@@ -883,4 +897,9 @@ public class RaceViewController extends Controller {
mapToggle = !mapToggle;
}
public void deathOKPressed(){
deathPane.setDisable(true);
deathPane.setVisible(false);
}
}