diff --git a/SMIMS-Game/Groundflower.class b/SMIMS-Game/Groundflower.class index 0874a3f..eb6a43e 100644 Binary files a/SMIMS-Game/Groundflower.class and b/SMIMS-Game/Groundflower.class differ diff --git a/SMIMS-Game/Heart.class b/SMIMS-Game/Heart.class new file mode 100644 index 0000000..27ead24 Binary files /dev/null and b/SMIMS-Game/Heart.class differ diff --git a/SMIMS-Game/Heart.ctxt b/SMIMS-Game/Heart.ctxt new file mode 100644 index 0000000..8c528f2 --- /dev/null +++ b/SMIMS-Game/Heart.ctxt @@ -0,0 +1,7 @@ +#BlueJ class context +comment0.target=Heart +comment0.text=\r\n\ Write\ a\ description\ of\ class\ Heart\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n +comment1.params= +comment1.target=void\ act() +comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ Heart\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n +numComments=2 diff --git a/SMIMS-Game/Heart.java b/SMIMS-Game/Heart.java new file mode 100644 index 0000000..6c7406e --- /dev/null +++ b/SMIMS-Game/Heart.java @@ -0,0 +1,19 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class Heart here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class Heart extends Actor +{ + /** + * Act - do whatever the Heart wants to do. This method is called whenever + * the 'Act' or 'Run' button gets pressed in the environment. + */ + public void act() + { + // Add your action code here. + } +} diff --git a/SMIMS-Game/MyWorld.class b/SMIMS-Game/MyWorld.class index ca8d74b..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 8876e2f..4e70578 100644 --- a/SMIMS-Game/MyWorld.java +++ b/SMIMS-Game/MyWorld.java @@ -59,6 +59,14 @@ public class MyWorld extends World plattform2.setLocation(308,382); Healthbar healthbar = new Healthbar(); addObject(healthbar,50,50); + Heart heart = new Heart(); + addObject(heart,371,27); + Heart heart2 = new Heart(); + addObject(heart2,343,27); + Heart heart3 = new Heart(); + addObject(heart3,314,27); + + addObject(new TemporaryGround(60*50), 200, 575); } public void act() @@ -103,6 +111,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 + } } 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()