PowerUp Items bewegen sich jetzt nach unten und lösen auch nur noch das richtige PowerUp aus

This commit is contained in:
2026-09-17 09:39:47 +02:00
parent 3d047538f1
commit c0c5151c41
17 changed files with 190 additions and 119 deletions
+5 -2
View File
@@ -118,7 +118,7 @@ public class Player extends Actor
health--;
getWorld().removeObjects(getIntersectingObjects(Projectile.class));
getWorld().removeObjects(getIntersectingObjects(Enemy.class));
getWorld().removeObjects(getIntersectingObjects(Spike.class));
getWorld().removeObjects(getWorld().getObjects(Spike.class));
}
}
@@ -137,7 +137,7 @@ public class Player extends Actor
}
}
public void reveivePowerUp(int duration, String type){
public void receivePowerUp(int duration, String type){
switch(type){
case "dummy":
break;
@@ -145,10 +145,12 @@ public class Player extends Actor
currentJumpStrength = defaultJumpStrength;
currentJumpStrength += jumpBoostStrength;
jumpBoostDuration = duration;
break;
case "Heal":
if (health < MAX_HEALTH){
health++;
}
break;
case "GroundPower":
World theWorld= this.getWorld();
if(!theWorld.getObjects(TemporaryGround.class).isEmpty())
@@ -159,6 +161,7 @@ public class Player extends Actor
{
theWorld.addObject((new TemporaryGround(duration)), 200, 550);
}
break;
}
}
}