Browse Source

added state for edible ghosts in GameManager

remotes/origin/player
fdai7910 11 months ago
parent
commit
eb100975f1
  1. 8
      src/main/java/pacmanGame/GameManager.java

8
src/main/java/pacmanGame/GameManager.java

@ -7,6 +7,7 @@ public class GameManager {
public Visualizer visualizer;
public Player player;
public int score = 0;
public Boolean ghostIsEdible = false;
public GameManager() {
setupGame();
@ -77,4 +78,11 @@ public class GameManager {
public void updatePlayerCell() {
map.GetCell(player.position).triggerItem();
}
public void makeGhostEdible(int timeStopPillEffect) {
ghostIsEdible = true;
if(time == timeStopPillEffect) {
ghostIsEdible = false;
}
}
}
Loading…
Cancel
Save