Browse Source

remaining Lives and failed Attempts

remotes/origin/menu
fdai2751 11 months ago
parent
commit
2252f665fc
  1. 16
      src/main/java/pacmanGame/GameManager.java

16
src/main/java/pacmanGame/GameManager.java

@ -8,8 +8,12 @@ public class GameManager {
public Player player; public Player player;
public int score = 0; public int score = 0;
public boolean isPaused; public boolean isPaused;
public int livesRemaining;
public int failedAttempts;
public GameManager() { public GameManager() {
livesRemaining = 3;
failedAttempts = 0;
setupGame(); setupGame();
} }
@ -23,9 +27,19 @@ public class GameManager {
ghosts[i] = new Ghost(this); ghosts[i] = new Ghost(this);
} }
isPaused = false; isPaused = false;
}
/* public void handleGhostCollision() {
livesRemaining--; // Reduziere verbleibende leben um 1
failedAttempts++; // Erhöhe die Anzahl der Fehlversuche
if(livesRemaining <= 0) {
gameOver(); //wenn Keine Leben mehr übrig sind.
}
} }
public void gameOver() {
// todo
}
*/
public void Update() { public void Update() {
if(!isPaused) { if(!isPaused) {
visualizer.Update(); visualizer.Update();

Loading…
Cancel
Save