Fix lives being removed on new round

This commit is contained in:
Matt Low 2020-01-05 12:47:39 +04:00
parent 31a2657c13
commit fb3e26da35

View File

@ -144,7 +144,6 @@ public class PlayState extends LevelState {
} }
private void resetField() { private void resetField() {
lives--;
frightTimer = 0f; frightTimer = 0f;
ghostsCaught = 0; ghostsCaught = 0;
lastGhostCaptured = null; lastGhostCaptured = null;
@ -169,6 +168,7 @@ public class PlayState extends LevelState {
} }
private void newGame() { private void newGame() {
lives--;
initializeRound(); initializeRound();
resetField(); resetField();
} }
@ -449,6 +449,7 @@ public class PlayState extends LevelState {
pacman.update(dt); pacman.update(dt);
if (pacman.deathFrame == 13) { if (pacman.deathFrame == 13) {
if (lives > 0) { if (lives > 0) {
lives--;
resetField(); resetField();
setGameState(GameState.START_ROUND_WAIT); setGameState(GameState.START_ROUND_WAIT);
} else { } else {