From d170004c363f9a035a279d4b91eaded71dcf5af4 Mon Sep 17 00:00:00 2001 From: fdai7753 Date: Wed, 7 Feb 2024 19:01:29 +0100 Subject: [PATCH] refactoring: Fixed ghost count stuck at 4 --- src/main/java/pacmanGame/GameManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 3433aab..5cdb53b 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -9,13 +9,14 @@ public class GameManager { public int score = 0; public boolean ghostIsEdible = false; public boolean isPaused; + public final int ghostCount = 10; public GameManager() { setupGame(); } public void setupGame(){ - ghosts = new Ghost[4]; + ghosts = new Ghost[ghostCount]; for (int i = 0; i < ghosts.length; i++) { ghosts[i] = new Ghost(this, i); }