Projektil und Game Over Transition bei Kollision

This commit is contained in:
2026-09-15 10:21:16 +02:00
parent ec0e80fe97
commit 07c5614d44
16 changed files with 126 additions and 12 deletions
+13
View File
@@ -13,6 +13,7 @@ public class Player extends Actor
public void act()
{
player_movement();
collision();
}
public void player_movement(){
@@ -35,4 +36,16 @@ public class Player extends Actor
return floor != null;
}
public boolean collision(){
if (getIntersectingObjects(Projectile.class).size()>0)
{
Greenfoot.setWorld(new GameOverWorld());
return true;
}
else
{
return false;
}
}
}