Minor change
Always return when the gameOverTimer or newGameTmer is > 0 Move variables
This commit is contained in:
parent
a8e4d2526e
commit
d33435bf42
@ -29,6 +29,10 @@ public class PlayState extends LevelState {
|
|||||||
|
|
||||||
private TextureRegion lifeSprite;
|
private TextureRegion lifeSprite;
|
||||||
|
|
||||||
|
public Random random;
|
||||||
|
|
||||||
|
private long sirenId;
|
||||||
|
|
||||||
private int pelletCount;
|
private int pelletCount;
|
||||||
private int pelletEatenCount;
|
private int pelletEatenCount;
|
||||||
private int score;
|
private int score;
|
||||||
@ -36,8 +40,6 @@ public class PlayState extends LevelState {
|
|||||||
private int round;
|
private int round;
|
||||||
private boolean paused = false;
|
private boolean paused = false;
|
||||||
|
|
||||||
private long sirenId;
|
|
||||||
|
|
||||||
private float readyTimer;
|
private float readyTimer;
|
||||||
private float gameOverTimer;
|
private float gameOverTimer;
|
||||||
private float newGameTimer;
|
private float newGameTimer;
|
||||||
@ -46,8 +48,6 @@ public class PlayState extends LevelState {
|
|||||||
|
|
||||||
private boolean pacmanCaught;
|
private boolean pacmanCaught;
|
||||||
|
|
||||||
public Random random;
|
|
||||||
|
|
||||||
public Pacman pacman;
|
public Pacman pacman;
|
||||||
public Ghost[] ghosts;
|
public Ghost[] ghosts;
|
||||||
|
|
||||||
@ -118,9 +118,8 @@ public class PlayState extends LevelState {
|
|||||||
gameOverTimer -= dt;
|
gameOverTimer -= dt;
|
||||||
if (gameOverTimer <= 0) {
|
if (gameOverTimer <= 0) {
|
||||||
newGame();
|
newGame();
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (readyTimer > 0) {
|
if (readyTimer > 0) {
|
||||||
@ -136,9 +135,8 @@ public class PlayState extends LevelState {
|
|||||||
newGameTimer -= dt;
|
newGameTimer -= dt;
|
||||||
if (newGameTimer <= 0) {
|
if (newGameTimer <= 0) {
|
||||||
setupGame();
|
setupGame();
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frightTimer > 0) {
|
if (frightTimer > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user