diff --git a/SMIMS-Game/BreakingPlattform.class b/SMIMS-Game/BreakingPlattform.class new file mode 100644 index 0000000..c6d81c8 Binary files /dev/null and b/SMIMS-Game/BreakingPlattform.class differ diff --git a/SMIMS-Game/BreakingPlattform.ctxt b/SMIMS-Game/BreakingPlattform.ctxt new file mode 100644 index 0000000..82d1599 --- /dev/null +++ b/SMIMS-Game/BreakingPlattform.ctxt @@ -0,0 +1,9 @@ +#BlueJ class context +comment0.target=BreakingPlattform +comment0.text=\r\n\ Write\ a\ description\ of\ class\ BreakingPlattform\ 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\ BreakingPlattform\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n +comment2.params= +comment2.target=void\ breakPlattform() +numComments=3 diff --git a/SMIMS-Game/BreakingPlattform.java b/SMIMS-Game/BreakingPlattform.java new file mode 100644 index 0000000..2fc9b35 --- /dev/null +++ b/SMIMS-Game/BreakingPlattform.java @@ -0,0 +1,32 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class BreakingPlattform here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class BreakingPlattform extends Plattform +{ + boolean IsBreaking= false; + /** + * Act - do whatever the BreakingPlattform wants to do. This method is called whenever + * the 'Act' or 'Run' button gets pressed in the environment. + */ + public void act() + { + super.act(); + if(this.PlayerOnPlattform() && IsBreaking==false) + { + IsBreaking= true; + } + } + + public void breakPlattform() + { + if(this.PlayerOnPlattform()) + { + + } + } +} diff --git a/SMIMS-Game/MovingPlattform.class b/SMIMS-Game/MovingPlattform.class new file mode 100644 index 0000000..3673817 Binary files /dev/null and b/SMIMS-Game/MovingPlattform.class differ diff --git a/SMIMS-Game/MovingPlattform.ctxt b/SMIMS-Game/MovingPlattform.ctxt new file mode 100644 index 0000000..c3f340b --- /dev/null +++ b/SMIMS-Game/MovingPlattform.ctxt @@ -0,0 +1,11 @@ +#BlueJ class context +comment0.target=MovingPlattform +comment0.text=\r\n\ Write\ a\ description\ of\ class\ MovingPlattform\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n +comment1.params=pSpeed +comment1.target=MovingPlattform(int) +comment2.params= +comment2.target=void\ act() +comment2.text=\r\n\ Act\ -\ do\ whatever\ the\ MovingPlattform\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n +comment3.params= +comment3.target=void\ bewege() +numComments=4 diff --git a/SMIMS-Game/MovingPlattform.java b/SMIMS-Game/MovingPlattform.java new file mode 100644 index 0000000..9aca730 --- /dev/null +++ b/SMIMS-Game/MovingPlattform.java @@ -0,0 +1,38 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class MovingPlattform here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class MovingPlattform extends Plattform +{ + int speed; + + public MovingPlattform(int pSpeed) + { + speed= pSpeed; + } + + /** + * Act - do whatever the MovingPlattform 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. + super.act(); + this.bewege(); + } + + public void bewege() + { + MyWorld theWorld= (MyWorld) this.getWorld(); + move(speed); + if(this.getX()<5 || this.getX()<=theWorld.getWidth()) + { + this.loescheMich(); + } + } +} diff --git a/SMIMS-Game/Plattform.class b/SMIMS-Game/Plattform.class new file mode 100644 index 0000000..ebbf481 Binary files /dev/null and b/SMIMS-Game/Plattform.class differ diff --git a/SMIMS-Game/Plattform.ctxt b/SMIMS-Game/Plattform.ctxt new file mode 100644 index 0000000..cb8486f --- /dev/null +++ b/SMIMS-Game/Plattform.ctxt @@ -0,0 +1,13 @@ +#BlueJ class context +comment0.target=Plattform +comment0.text=\r\n\ Write\ a\ description\ of\ class\ Plattform\ 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\ Plattform\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n +comment2.params= +comment2.target=void\ scrollNachUnten() +comment3.params= +comment3.target=void\ loescheMich() +comment4.params= +comment4.target=boolean\ PlayerOnPlattform() +numComments=5 diff --git a/SMIMS-Game/Plattform.java b/SMIMS-Game/Plattform.java new file mode 100644 index 0000000..232991c --- /dev/null +++ b/SMIMS-Game/Plattform.java @@ -0,0 +1,55 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class Plattform here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class Plattform extends Actor +{ + /** + * Act - do whatever the Plattform wants to do. This method is called whenever + * the 'Act' or 'Run' button gets pressed in the environment. + */ + public void act() + { + this.scrollNachUnten(); + // Add your action code here. + } + + public void scrollNachUnten() + { + MyWorld welt= (MyWorld) getWorld(); + setLocation(this.getX(),this.getY()+2); // Nach unten turnen + if(this.getY()>= welt.getHeight()-5 ||this.getY()<=0) + { + this.loescheMich(); + } + } + + public void loescheMich() + { + getWorld().removeObject(this); + } + + public boolean PlayerOnPlattform() + { + Actor Spieler= getOneObjectAtOffset(0, 5, Player.class); + if(Spieler!= null) + { + if(Spieler.equals(Player.class)) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } +} diff --git a/SMIMS-Game/images/Wall.jpg b/SMIMS-Game/images/Wall.jpg new file mode 100644 index 0000000..66e4344 Binary files /dev/null and b/SMIMS-Game/images/Wall.jpg differ diff --git a/SMIMS-Game/images/bathroom-tile.jpg b/SMIMS-Game/images/bathroom-tile.jpg new file mode 100644 index 0000000..afee904 Binary files /dev/null and b/SMIMS-Game/images/bathroom-tile.jpg differ diff --git a/SMIMS-Game/images/sandstone.jpg b/SMIMS-Game/images/sandstone.jpg new file mode 100644 index 0000000..0280dfc Binary files /dev/null and b/SMIMS-Game/images/sandstone.jpg differ