Browse Source

Refactoring: player died after 3 collision and gameOver

main
fdai2751 11 months ago
parent
commit
866d55e96b
  1. 2
      src/main/java/pacmanGame/GameManager.java

2
src/main/java/pacmanGame/GameManager.java

@ -58,7 +58,7 @@ public class GameManager {
if(time%moveSpeed == 0) { if(time%moveSpeed == 0) {
player.Move(); player.Move();
if(ghostPlayerColisionTest()) { if(ghostPlayerColisionTest()) {
livesRemaining--;
handleGhostCollision();
} }
for(int i = 0; i<ghostCount; i++) { for(int i = 0; i<ghostCount; i++) {
ghosts[i].move(); ghosts[i].move();

Loading…
Cancel
Save