diff --git a/SMIMS-Game/Groundflower.class b/SMIMS-Game/Groundflower.class index 0d343b5..eb6a43e 100644 Binary files a/SMIMS-Game/Groundflower.class and b/SMIMS-Game/Groundflower.class differ diff --git a/SMIMS-Game/Groundflower.java b/SMIMS-Game/Groundflower.java index 90de034..b52dd85 100644 --- a/SMIMS-Game/Groundflower.java +++ b/SMIMS-Game/Groundflower.java @@ -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); } } } diff --git a/SMIMS-Game/MyWorld.class b/SMIMS-Game/MyWorld.class index 8c6ebfe..700c3de 100644 Binary files a/SMIMS-Game/MyWorld.class and b/SMIMS-Game/MyWorld.class differ diff --git a/SMIMS-Game/MyWorld.java b/SMIMS-Game/MyWorld.java index 0add624..a113886 100644 --- a/SMIMS-Game/MyWorld.java +++ b/SMIMS-Game/MyWorld.java @@ -58,6 +58,8 @@ public class MyWorld extends World plattform2.setLocation(308,382); Healthbar healthbar = new Healthbar(); addObject(healthbar,50,50); + + addObject(new TemporaryGround(60*50), 200, 575); } public void act() @@ -101,6 +103,10 @@ public class MyWorld extends World addObject(new SpikedPlattform(100), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform } + if(Greenfoot.getRandomNumber(100000)>=99750) + { + addObject(new Groundflower(), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform + } } public void projectile(){ diff --git a/SMIMS-Game/Plattform.class b/SMIMS-Game/Plattform.class index fe23c79..870c595 100644 Binary files a/SMIMS-Game/Plattform.class and b/SMIMS-Game/Plattform.class differ diff --git a/SMIMS-Game/Plattform.java b/SMIMS-Game/Plattform.java index bc4312b..64ea5f9 100644 --- a/SMIMS-Game/Plattform.java +++ b/SMIMS-Game/Plattform.java @@ -43,7 +43,7 @@ public class Plattform extends Actor Player Spieler= (Player) getOneIntersectingObject(Player.class); if(this.isTouching(Player.class)) { - if(Spieler.getY()