diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 40bae37..16e7e23 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -2,7 +2,7 @@ package pacmanGame; public class GameManager { public int time = 0; - + public Ghost[] ghosts; public Map map; public Visualizer visualizer; public Player player; @@ -11,6 +11,10 @@ public class GameManager { 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(); + } } public void Update() { diff --git a/src/main/java/pacmanGame/Ghost.java b/src/main/java/pacmanGame/Ghost.java index 0a3be13..388fbc7 100644 --- a/src/main/java/pacmanGame/Ghost.java +++ b/src/main/java/pacmanGame/Ghost.java @@ -2,4 +2,10 @@ package pacmanGame; public class Ghost { public Vector2 position; + public final GameManager gameManager; + + public Ghost(GameManager gameManager) { + this.gameManager = new GameManager(); + } + } diff --git a/src/main/java/pacmanGame/GhostBehavior.java b/src/main/java/pacmanGame/GhostBehavior.java index c71c458..5d0cacd 100644 --- a/src/main/java/pacmanGame/GhostBehavior.java +++ b/src/main/java/pacmanGame/GhostBehavior.java @@ -2,4 +2,6 @@ package pacmanGame; public interface GhostBehavior { public Vector2 GetDirection(); + + }