PowerUp Items bewegen sich jetzt nach unten und lösen auch nur noch das richtige PowerUp aus
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user