From e060b184fbff799b82c5040a87e20c3a36debf08 Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Sat, 3 Feb 2024 21:41:36 +0100 Subject: [PATCH] added destroyCherry function to GameManager --- src/main/java/pacmanGame/GameManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 9bf19bc..172cbd3 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -31,12 +31,19 @@ public class GameManager { if(time == 300) { spawnCherry(); } + if (time == 600) { + destroyCherry(); + } time++; } public void spawnCherry() { map.GetCell(map.playerSpawn).type = "cherry"; } + + public void destroyCherry() { + map.GetCell(map.playerSpawn).type = "empty"; + } public void ProcessInput(char inputChar) { if(inputChar == 27) {