From 6f4b77ba53fd9649fb1777d2106fad9e356d41d5 Mon Sep 17 00:00:00 2001 From: fdai2751 Date: Thu, 8 Feb 2024 20:31:37 +0100 Subject: [PATCH] Refactoring: setupGame() --- src/main/java/pacmanGame/GameManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 0b0e6d0..8f79e6e 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -16,14 +16,15 @@ public class GameManager { public int moveSpeed; public GameManager() { - livesRemaining = 3; - failedAttempts = 0; + setupGame(); } public void setupGame(){ time = 0; moveSpeed = 5; + livesRemaining = 3; + failedAttempts = 0; ghosts = new Ghost[ghostCount]; for (int i = 0; i < ghosts.length; i++) { ghosts[i] = new Ghost(this, i);