From 33e43bb6d3de904c501c766e2de253bd10a4d308 Mon Sep 17 00:00:00 2001 From: fdai2751 Date: Wed, 31 Jan 2024 21:48:04 +0100 Subject: [PATCH] refactoring: new Function setupGame initialized --- src/main/java/pacmanGame/GameManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index bebc234..5ac9fcb 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -8,18 +8,21 @@ public class GameManager { public Player player; public GameManager() { - map = new Map(); + setupGame(); + } + + public void setupGame(){ + map = new Map(); visualizer = new VisualizerPlainText(this); player = new Player(this); ghosts = new Ghost[4]; for(int i = 0; i < ghosts.length; i++) { ghosts[i] = new Ghost(this); } - } - + + } public void Update() { visualizer.Update(); - time++; }