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