On death a menu will pop up telling the user he is dead. #story[1292]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user