diff --git a/SMIMS-Game/BreakingPlattform.class b/SMIMS-Game/BreakingPlattform.class index c5111c7..2718440 100644 Binary files a/SMIMS-Game/BreakingPlattform.class and b/SMIMS-Game/BreakingPlattform.class differ diff --git a/SMIMS-Game/BreakingPlattform.java b/SMIMS-Game/BreakingPlattform.java index ef60cdf..86aec90 100644 --- a/SMIMS-Game/BreakingPlattform.java +++ b/SMIMS-Game/BreakingPlattform.java @@ -25,7 +25,7 @@ public class BreakingPlattform extends Plattform { IsBreaking= true; //Greenfoot.playSound("...") - this.setImage("BreakingPlattform2.png"); + this.setImage("Breaking2.png"); } if(IsBreaking) diff --git a/SMIMS-Game/Enemy.ctxt b/SMIMS-Game/Enemy.ctxt index b6b41cc..214f50f 100644 --- a/SMIMS-Game/Enemy.ctxt +++ b/SMIMS-Game/Enemy.ctxt @@ -1,11 +1,7 @@ #BlueJ class context comment0.target=Enemy -comment1.params=targetX\ targetY -comment1.target=Enemy(int,\ int) +comment1.params= +comment1.target=void\ act() comment2.params= -comment2.target=void\ act() -comment3.params=targetX\ targetY -comment3.target=void\ moveToTargetLocation(int,\ int) -comment4.params= -comment4.target=void\ shootAtPlayer() -numComments=5 +comment2.target=void\ shootAtPlayer() +numComments=3 diff --git a/SMIMS-Game/GameOverWorld.class b/SMIMS-Game/GameOverWorld.class index efc7790..613d6aa 100644 Binary files a/SMIMS-Game/GameOverWorld.class and b/SMIMS-Game/GameOverWorld.class differ diff --git a/SMIMS-Game/GameOverWorld.java b/SMIMS-Game/GameOverWorld.java index d597e54..c93053a 100644 --- a/SMIMS-Game/GameOverWorld.java +++ b/SMIMS-Game/GameOverWorld.java @@ -27,7 +27,7 @@ public class GameOverWorld extends World private void prepare() { Button button = new Button(); - addObject(button,200,350); + addObject(button,200,320); button.setImage("Neustart.png"); } } 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.java b/SMIMS-Game/MyWorld.java index a113886..8598d1a 100644 --- a/SMIMS-Game/MyWorld.java +++ b/SMIMS-Game/MyWorld.java @@ -58,7 +58,13 @@ 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); } diff --git a/SMIMS-Game/Player.class b/SMIMS-Game/Player.class index dd05d01..3dfe572 100644 Binary files a/SMIMS-Game/Player.class and b/SMIMS-Game/Player.class differ diff --git a/SMIMS-Game/Player.java b/SMIMS-Game/Player.java index b84f1d9..3c1d57a 100644 --- a/SMIMS-Game/Player.java +++ b/SMIMS-Game/Player.java @@ -112,12 +112,17 @@ public class Player extends Actor public void collision(){ if (getIntersectingObjects(Projectile.class).size()>0 - || getIntersectingObjects(Enemy.class).size()>0) + || getIntersectingObjects(Enemy.class).size()>0 + || getIntersectingObjects(Spike.class).size()>0) { health--; getWorld().removeObjects(getIntersectingObjects(Projectile.class)); getWorld().removeObjects(getIntersectingObjects(Enemy.class)); - + getWorld().removeObjects(getIntersectingObjects(Spike.class)); + getWorld().removeObject(getWorld().getObjects(Heart.class).get(0)); + //if(health<=2){ + // getWorld().removeObject(getWorld().getObjects(Heart.class).get(0)); + //} } } diff --git a/SMIMS-Game/Spike.class b/SMIMS-Game/Spike.class index 56b67f8..3931ddb 100644 Binary files a/SMIMS-Game/Spike.class and b/SMIMS-Game/Spike.class differ diff --git a/SMIMS-Game/Spike.java b/SMIMS-Game/Spike.java index 0a69da3..3babe27 100644 --- a/SMIMS-Game/Spike.java +++ b/SMIMS-Game/Spike.java @@ -20,11 +20,6 @@ public class Spike extends Actor */ public void act() { - // Add your action code here. - if(this.isTouching(Player.class)) - { - Greenfoot.setWorld(new GameOverWorld()); - } this.bewege(); } diff --git a/SMIMS-Game/StartWorld.class b/SMIMS-Game/StartWorld.class index 29fa851..cb02421 100644 Binary files a/SMIMS-Game/StartWorld.class and b/SMIMS-Game/StartWorld.class differ diff --git a/SMIMS-Game/StartWorld.java b/SMIMS-Game/StartWorld.java index 81f454a..59c091d 100644 --- a/SMIMS-Game/StartWorld.java +++ b/SMIMS-Game/StartWorld.java @@ -26,7 +26,7 @@ public class StartWorld extends World private void prepare() { Button button = new Button(); - addObject(button,200,350); + addObject(button,200,320); button.setImage("Start.png"); } } diff --git a/SMIMS-Game/UnactiveSpike.class b/SMIMS-Game/UnactiveSpike.class index a1f05c4..839ee59 100644 Binary files a/SMIMS-Game/UnactiveSpike.class and b/SMIMS-Game/UnactiveSpike.class differ diff --git a/SMIMS-Game/UnactiveSpike.java b/SMIMS-Game/UnactiveSpike.java index cb62ea0..42d98b6 100644 --- a/SMIMS-Game/UnactiveSpike.java +++ b/SMIMS-Game/UnactiveSpike.java @@ -30,7 +30,7 @@ public class UnactiveSpike extends Actor MyWorld theWorld= (MyWorld) this.getWorld(); Spike BeispielSpike=new Spike(1); GreenfootImage SpikeImage= BeispielSpike.getImage(); - theWorld.addObject(new Spike(speed), this.getX(), (this.getY()- this.getImage().getHeight()/2)-10); //die Zahl Minus damit ist endlich passt + theWorld.addObject(new Spike(speed), this.getX(), (this.getY()- this.getImage().getHeight()/2)-2); //die Zahl Minus damit ist endlich passt geloescht=true; } if(geloescht) diff --git a/SMIMS-Game/images/Breaking1.png b/SMIMS-Game/images/Breaking1.png new file mode 100644 index 0000000..6c93ee2 Binary files /dev/null and b/SMIMS-Game/images/Breaking1.png differ diff --git a/SMIMS-Game/images/Breaking2.png b/SMIMS-Game/images/Breaking2.png new file mode 100644 index 0000000..d7b8f1e Binary files /dev/null and b/SMIMS-Game/images/Breaking2.png differ diff --git a/SMIMS-Game/images/Health.png b/SMIMS-Game/images/Health.png new file mode 100644 index 0000000..20c407a Binary files /dev/null and b/SMIMS-Game/images/Health.png differ diff --git a/SMIMS-Game/images/Spikes.png b/SMIMS-Game/images/Spikes.png new file mode 100644 index 0000000..28f786f Binary files /dev/null and b/SMIMS-Game/images/Spikes.png differ diff --git a/SMIMS-Game/images/Spikes2.png b/SMIMS-Game/images/Spikes2.png new file mode 100644 index 0000000..e9ef0df Binary files /dev/null and b/SMIMS-Game/images/Spikes2.png differ diff --git a/SMIMS-Game/images/Spikes3.png b/SMIMS-Game/images/Spikes3.png new file mode 100644 index 0000000..55afbdc Binary files /dev/null and b/SMIMS-Game/images/Spikes3.png differ diff --git a/SMIMS-Game/images/StartBackground.png b/SMIMS-Game/images/StartBackground.png index 34bdc9b..0394ce3 100644 Binary files a/SMIMS-Game/images/StartBackground.png and b/SMIMS-Game/images/StartBackground.png differ diff --git a/SMIMS-Game/images/inactiveSpike.png b/SMIMS-Game/images/inactiveSpike.png new file mode 100644 index 0000000..6e35ec8 Binary files /dev/null and b/SMIMS-Game/images/inactiveSpike.png differ diff --git a/SMIMS-Game/images/singleSpike.png b/SMIMS-Game/images/singleSpike.png new file mode 100644 index 0000000..4a2ada1 Binary files /dev/null and b/SMIMS-Game/images/singleSpike.png differ diff --git a/SMIMS-Game/project.greenfoot b/SMIMS-Game/project.greenfoot index b339857..a717fb3 100644 --- a/SMIMS-Game/project.greenfoot +++ b/SMIMS-Game/project.greenfoot @@ -1,7 +1,7 @@ #Greenfoot project file class.BreakingPlattform.image=Unbenannt2.png class.Ground.image=weave.jpg -class.Groundflower.image=flower2.png +class.Groundflower.image=beeper.png class.MovingPlattform.image=Unbenannt.png class.Plattform.image=Plattform.png class.Player.image=ppl2.png @@ -13,128 +13,119 @@ dependency1.from=PlayerTestWorld dependency1.to=Ground dependency1.type=UsesDependency dependency10.from=MyWorld -dependency10.to=BreakingPlattform +dependency10.to=SpikedPlattform dependency10.type=UsesDependency dependency11.from=MyWorld -dependency11.to=SpikedPlattform +dependency11.to=Projectile dependency11.type=UsesDependency dependency12.from=MyWorld -dependency12.to=Groundflower +dependency12.to=TargetingProjectile dependency12.type=UsesDependency -dependency13.from=MyWorld -dependency13.to=Projectile +dependency13.from=GameOverWorld +dependency13.to=Button dependency13.type=UsesDependency -dependency14.from=MyWorld -dependency14.to=TargetingProjectile +dependency14.from=StartWorld +dependency14.to=Button dependency14.type=UsesDependency -dependency15.from=GameOverWorld -dependency15.to=Button +dependency15.from=UnactiveSpike +dependency15.to=SpikedPlattform dependency15.type=UsesDependency -dependency16.from=StartWorld -dependency16.to=Button +dependency16.from=UnactiveSpike +dependency16.to=MyWorld dependency16.type=UsesDependency dependency17.from=UnactiveSpike -dependency17.to=SpikedPlattform +dependency17.to=Spike dependency17.type=UsesDependency -dependency18.from=UnactiveSpike +dependency18.from=Button dependency18.to=MyWorld dependency18.type=UsesDependency -dependency19.from=UnactiveSpike -dependency19.to=Spike +dependency19.from=PowerUps +dependency19.to=Player dependency19.type=UsesDependency dependency2.from=PlayerTestWorld dependency2.to=Player dependency2.type=UsesDependency -dependency20.from=Button -dependency20.to=MyWorld +dependency20.from=HealthItem +dependency20.to=Player dependency20.type=UsesDependency -dependency21.from=PowerUps +dependency21.from=JumpBoostItem dependency21.to=Player dependency21.type=UsesDependency -dependency22.from=HealthItem +dependency22.from=Groundflower dependency22.to=Player dependency22.type=UsesDependency -dependency23.from=JumpBoostItem +dependency23.from=Enemy dependency23.to=Player dependency23.type=UsesDependency -dependency24.from=Groundflower -dependency24.to=Player +dependency24.from=Enemy +dependency24.to=EnemyProjectile dependency24.type=UsesDependency -dependency25.from=Enemy -dependency25.to=Player +dependency25.from=Spike +dependency25.to=GameOverWorld dependency25.type=UsesDependency -dependency26.from=Enemy -dependency26.to=EnemyProjectile +dependency26.from=Spike +dependency26.to=MyWorld dependency26.type=UsesDependency dependency27.from=Spike -dependency27.to=GameOverWorld +dependency27.to=Player dependency27.type=UsesDependency -dependency28.from=Spike -dependency28.to=MyWorld +dependency28.from=Player +dependency28.to=GameOverWorld dependency28.type=UsesDependency -dependency29.from=Spike -dependency29.to=Player +dependency29.from=Player +dependency29.to=Plattform dependency29.type=UsesDependency dependency3.from=PlayerTestWorld dependency3.to=JumpBoostItem dependency3.type=UsesDependency dependency30.from=Player -dependency30.to=GameOverWorld +dependency30.to=PlayerProjectile dependency30.type=UsesDependency dependency31.from=Player -dependency31.to=Plattform +dependency31.to=TemporaryGround dependency31.type=UsesDependency dependency32.from=Player -dependency32.to=PlayerProjectile +dependency32.to=Projectile dependency32.type=UsesDependency dependency33.from=Player -dependency33.to=TemporaryGround +dependency33.to=Enemy dependency33.type=UsesDependency -dependency34.from=Player -dependency34.to=Projectile +dependency34.from=Healthbar +dependency34.to=Player dependency34.type=UsesDependency -dependency35.from=Player -dependency35.to=Enemy +dependency35.from=Plattform +dependency35.to=MyWorld dependency35.type=UsesDependency -dependency36.from=Healthbar +dependency36.from=Plattform dependency36.to=Player dependency36.type=UsesDependency -dependency37.from=Plattform +dependency37.from=MovingPlattform dependency37.to=MyWorld dependency37.type=UsesDependency -dependency38.from=Plattform +dependency38.from=MovingPlattform dependency38.to=Player dependency38.type=UsesDependency -dependency39.from=MovingPlattform -dependency39.to=MyWorld +dependency39.from=SpikedPlattform +dependency39.to=Spike dependency39.type=UsesDependency dependency4.from=MyWorld dependency4.to=Player dependency4.type=UsesDependency -dependency40.from=MovingPlattform -dependency40.to=Player +dependency40.from=SpikedPlattform +dependency40.to=GameOverWorld dependency40.type=UsesDependency -dependency41.from=TemporaryGround -dependency41.to=Player +dependency41.from=SpikedPlattform +dependency41.to=MyWorld dependency41.type=UsesDependency dependency42.from=SpikedPlattform -dependency42.to=Spike +dependency42.to=UnactiveSpike dependency42.type=UsesDependency -dependency43.from=SpikedPlattform -dependency43.to=GameOverWorld +dependency43.from=TargetingProjectile +dependency43.to=Player dependency43.type=UsesDependency -dependency44.from=SpikedPlattform -dependency44.to=MyWorld +dependency44.from=PlayerProjectile +dependency44.to=Enemy dependency44.type=UsesDependency -dependency45.from=SpikedPlattform -dependency45.to=UnactiveSpike -dependency45.type=UsesDependency -dependency46.from=TargetingProjectile -dependency46.to=Player -dependency46.type=UsesDependency -dependency47.from=PlayerProjectile -dependency47.to=Enemy -dependency47.type=UsesDependency dependency5.from=MyWorld dependency5.to=Score dependency5.type=UsesDependency @@ -145,17 +136,17 @@ dependency7.from=MyWorld dependency7.to=Healthbar dependency7.type=UsesDependency dependency8.from=MyWorld -dependency8.to=TemporaryGround +dependency8.to=MovingPlattform dependency8.type=UsesDependency dependency9.from=MyWorld -dependency9.to=MovingPlattform +dependency9.to=BreakingPlattform dependency9.type=UsesDependency -editor.fx.0.height=1048 -editor.fx.0.width=1936 -editor.fx.0.x=-8 -editor.fx.0.y=-8 +editor.fx.0.height=739 +editor.fx.0.width=816 +editor.fx.0.x=552 +editor.fx.0.y=98 height=1048 -package.numDependencies=47 +package.numDependencies=44 package.numTargets=25 project.charset=UTF-8 publish.hasSource=false