From d33435bf42e69be80112287e9fcf6401499cd9df Mon Sep 17 00:00:00 2001 From: Matt Low Date: Sat, 28 Dec 2019 00:53:38 +0400 Subject: [PATCH] Minor change Always return when the gameOverTimer or newGameTmer is > 0 Move variables --- core/src/com/me/pacman/state/PlayState.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/src/com/me/pacman/state/PlayState.java b/core/src/com/me/pacman/state/PlayState.java index f3f3751..7eb8e12 100644 --- a/core/src/com/me/pacman/state/PlayState.java +++ b/core/src/com/me/pacman/state/PlayState.java @@ -29,6 +29,10 @@ public class PlayState extends LevelState { private TextureRegion lifeSprite; + public Random random; + + private long sirenId; + private int pelletCount; private int pelletEatenCount; private int score; @@ -36,8 +40,6 @@ public class PlayState extends LevelState { private int round; private boolean paused = false; - private long sirenId; - private float readyTimer; private float gameOverTimer; private float newGameTimer; @@ -46,8 +48,6 @@ public class PlayState extends LevelState { private boolean pacmanCaught; - public Random random; - public Pacman pacman; public Ghost[] ghosts; @@ -118,9 +118,8 @@ public class PlayState extends LevelState { gameOverTimer -= dt; if (gameOverTimer <= 0) { newGame(); - } else { - return; } + return; } if (readyTimer > 0) { @@ -136,9 +135,8 @@ public class PlayState extends LevelState { newGameTimer -= dt; if (newGameTimer <= 0) { setupGame(); - } else { - return; } + return; } if (frightTimer > 0) {