[Solved]Issue With Death GUI

Started by TGames, Mon 26/11/2018 14:12:29

Previous topic - Next topic

TGames

In my game I have made a death GUI that appears when the player dies. It has a restore, restart, and quit button and pressing each of them will bring up the respective GUI. However, if I exit one of the other GUIs e.g. I say that I don't want to restart, the Death Gui does not pop up, and the player can continue playing. What should I do so that whenever the player is dead, the death GUI will pop up if you are not in the restore, restart, or quit GUI.
Thankyou!

Crimson Wizard

There may be various approaches to this including sophisticated ones like scripting a nested GUI system, but simpliest way seems to have a kind of "PlayerIsDead" variable which you set at player's death and test in event handlers of all buttons which close Restore/Restart/Quit dialogs. If it's on, then bring death gui back upon closing the previous one.

Slasher

Why die and then decide you don't want to die?  That is the question...

I have a similar thing in my last game and the game restores a saved point to try again..

Khris

You can simply keep the Death GUI open in the background; any of the three options will "close" it anyway (restore/restore will load a savegame which doesn't have the GUI open, and quitting the game will close the entire game).

TGames

Thank you all for your responses. I fixed my problem and it works great!

SMF spam blocked by CleanTalk