From e8a6b32276953e0ed1fd54292146c5b180a530fb Mon Sep 17 00:00:00 2001 From: fdai2751 Date: Thu, 8 Feb 2024 14:29:15 +0100 Subject: [PATCH] Refactoring: update function in GameManager --- src/main/java/pacmanGame/GameManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 0063ad3..96160ca 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -37,13 +37,23 @@ public class GameManager { ghosts[i].move(); } } + switch (time) { + case 300: + spawnCherry(); + case 600: + destroyCherry(); + default: + break; + } + time++; + /* if(time == 300) { spawnCherry(); } if (time == 600) { destroyCherry(); - } - time++; + }*/ + } public void spawnCherry() {