Browse Source

added Ghosts to GameManager

remotes/origin/menu
fdai2751 11 months ago
committed by Bertrand Goune
parent
commit
812dadfd12
  1. 6
      src/main/java/pacmanGame/GameManager.java
  2. 6
      src/main/java/pacmanGame/Ghost.java
  3. 2
      src/main/java/pacmanGame/GhostBehavior.java

6
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() {

6
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();
}
}

2
src/main/java/pacmanGame/GhostBehavior.java

@ -2,4 +2,6 @@ package pacmanGame;
public interface GhostBehavior {
public Vector2 GetDirection();
}
Loading…
Cancel
Save