|
|
@ -8,9 +8,13 @@ public class GameManager { |
|
|
|
public Player player; |
|
|
|
public int score = 0; |
|
|
|
public boolean isPaused; |
|
|
|
public int livesRemaining; |
|
|
|
public int failedAttempts; |
|
|
|
|
|
|
|
public GameManager() { |
|
|
|
setupGame(); |
|
|
|
livesRemaining = 3; |
|
|
|
failedAttempts = 0; |
|
|
|
setupGame(); |
|
|
|
} |
|
|
|
|
|
|
|
public void setupGame(){ |
|
|
@ -22,10 +26,20 @@ public class GameManager { |
|
|
|
for(int i = 0; i < ghosts.length; i++) { |
|
|
|
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() { |
|
|
|
if(!isPaused) { |
|
|
|
visualizer.Update(); |
|
|
|
xxxxxxxxxx