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
+6 -13
View File
@@ -15,23 +15,16 @@ public class Groundflower extends PowerUps
*/
public void act()
{
bewegeNachUnten();
this.touchedByPlayer();
// Add your action code here.
moveDown();
touchedByPlayer();
if (deleteAfterActCycle){
getWorld().removeObject(this);
}
}
@ Override void collect()
{
Player player = getIntersectingObjects(Player.class).get(0);
player.reveivePowerUp(duration, "GroundPower");
}
public void bewegeNachUnten()
{
this.setLocation(this.getX(), this.getY()+2);
if(this.getY()>=this.getWorld().getHeight())
{
this.getWorld().removeObject(this);
}
player.receivePowerUp(duration, "GroundPower");
}
}