Fix Health

This commit is contained in:
2026-09-17 09:24:04 +02:00
parent f7f611c2ae
commit c719e5b053
13 changed files with 102 additions and 67 deletions
+9 -3
View File
@@ -15,7 +15,13 @@ public class Groundflower extends PowerUps
*/
public void act()
{
bewegeNachUnten();
this.touchedByPlayer();
this.setLocation(this.getX(), this.getY()+2);
if(this.getY()>=this.getWorld().getHeight()-5)
{
this.getWorld().removeObject(this);
return;
}
this.touchedByPlayer();
// Add your action code here.
}
@@ -29,9 +35,9 @@ public class Groundflower extends PowerUps
public void bewegeNachUnten()
{
this.setLocation(this.getX(), this.getY()+2);
if(this.getY()>=this.getWorld().getHeight())
if(this.getY()>=this.getWorld().getHeight()-5)
{
this.getWorld().removeObject(this);
this.getWorld().removeObject(this);
}
}
}