From eb100975f1627ee997502c181d8c4a22e686a30e Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Sun, 4 Feb 2024 19:16:08 +0100 Subject: [PATCH] added state for edible ghosts in GameManager --- src/main/java/pacmanGame/GameManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 172cbd3..6c60efb 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/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; + } + } }