Browse Source

Refactoring: update function in GameManager

remotes/origin/ghostsbehaviour
fdai2751 11 months ago
parent
commit
e8a6b32276
  1. 14
      src/main/java/pacmanGame/GameManager.java

14
src/main/java/pacmanGame/GameManager.java

@ -37,13 +37,23 @@ public class GameManager {
ghosts[i].move(); ghosts[i].move();
} }
} }
switch (time) {
case 300:
spawnCherry();
case 600:
destroyCherry();
default:
break;
}
time++;
/*
if(time == 300) { if(time == 300) {
spawnCherry(); spawnCherry();
} }
if (time == 600) { if (time == 600) {
destroyCherry(); destroyCherry();
}
time++;
}*/
} }
public void spawnCherry() { public void spawnCherry() {

Loading…
Cancel
Save