Browse Source

added the collision between Gohst and player, discrement the playerlives

main
fdai2751 11 months ago
parent
commit
18caa47b49
  1. 3
      src/main/java/pacmanGame/GameManager.java

3
src/main/java/pacmanGame/GameManager.java

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

Loading…
Cancel
Save