Allow returning to play mode after time dead

This commit is contained in:
Lonami Exo 2017-02-05 16:32:19 +01:00
parent b760fe20cb
commit e6fb6b78e4

View file

@ -36,6 +36,8 @@ class GameScreen implements Screen, InputProcessor {
// by implementing different "isGameOver" etc. logic instead using an integer? // by implementing different "isGameOver" etc. logic instead using an integer?
private final int gameMode; private final int gameMode;
private boolean gameOverDone;
//endregion //endregion
//region Static members //region Static members
@ -87,10 +89,14 @@ class GameScreen implements Screen, InputProcessor {
} }
private void doGameOver() { private void doGameOver() {
if (!gameOverDone) {
holder.enabled = false; holder.enabled = false;
pauseMenu.show(true); pauseMenu.show(true);
if (Klooni.soundsEnabled()) if (Klooni.soundsEnabled())
gameOverSound.play(); gameOverSound.play();
gameOverDone = true;
}
} }
//endregion //endregion