Browse Source

refactoring: new Function setupGame initialized

remotes/origin/menu
fdai2751 11 months ago
parent
commit
33e43bb6d3
  1. 9
      src/main/java/pacmanGame/GameManager.java

9
src/main/java/pacmanGame/GameManager.java

@ -8,18 +8,21 @@ public class GameManager {
public Player player; public Player player;
public GameManager() { public GameManager() {
map = new Map();
setupGame();
}
public void setupGame(){
map = new Map();
visualizer = new VisualizerPlainText(this); visualizer = new VisualizerPlainText(this);
player = new Player(this); player = new Player(this);
ghosts = new Ghost[4]; ghosts = new Ghost[4];
for(int i = 0; i < ghosts.length; i++) { for(int i = 0; i < ghosts.length; i++) {
ghosts[i] = new Ghost(this); ghosts[i] = new Ghost(this);
} }
}
}
public void Update() { public void Update() {
visualizer.Update(); visualizer.Update();
time++; time++;
} }

Loading…
Cancel
Save