Bilder, Score Anzeige und Dauer der Plattform

This commit is contained in:
2026-09-17 16:06:17 +02:00
parent 40d5295716
commit 8a15fa5a51
17 changed files with 116 additions and 91 deletions
+4 -2
View File
@@ -38,7 +38,8 @@ public class Player extends Actor
//Check ob der Spieler am unteren Fensterrand ist
if (getY()+1 >= getWorld().getHeight()){
Greenfoot.setWorld(new GameOverWorld());
MyWorld world = (MyWorld) getWorld();
Greenfoot.setWorld(new GameOverWorld(world.score));
}
//Check ob der Spieler an der Seite vom Fenster ist
if (getX() <= 0){
@@ -127,7 +128,8 @@ public class Player extends Actor
public void checkHealth(){
if (health <= 0){
Greenfoot.setWorld(new GameOverWorld());
MyWorld world = (MyWorld) getWorld();
Greenfoot.setWorld(new GameOverWorld(world.score));
}
}