Lebensanzeige hinzugefügt
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -58,6 +58,12 @@ 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);
|
||||
}
|
||||
|
||||
public void act()
|
||||
|
||||
Binary file not shown.
@@ -119,7 +119,10 @@ public class Player extends Actor
|
||||
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));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -3,6 +3,7 @@ class.BreakingPlattform.image=Breaking1.png
|
||||
class.Button.image=button-red.png
|
||||
class.GameOverWorld.image=GameOverBackground.png
|
||||
class.Ground.image=weave.jpg
|
||||
class.Heart.image=Health.png
|
||||
class.JumpBoostItem.image=mushroom.png
|
||||
class.MovingPlattform.image=Platform1.png
|
||||
class.MyWorld.image=GameBackground.png
|
||||
@@ -18,104 +19,113 @@ dependency1.from=GameOverWorld
|
||||
dependency1.to=Button
|
||||
dependency1.type=UsesDependency
|
||||
dependency10.from=MyWorld
|
||||
dependency10.to=BreakingPlattform
|
||||
dependency10.to=MovingPlattform
|
||||
dependency10.type=UsesDependency
|
||||
dependency11.from=MyWorld
|
||||
dependency11.to=SpikedPlattform
|
||||
dependency11.to=BreakingPlattform
|
||||
dependency11.type=UsesDependency
|
||||
dependency12.from=MyWorld
|
||||
dependency12.to=Projectile
|
||||
dependency12.to=SpikedPlattform
|
||||
dependency12.type=UsesDependency
|
||||
dependency13.from=MyWorld
|
||||
dependency13.to=TargetingProjectile
|
||||
dependency13.to=Projectile
|
||||
dependency13.type=UsesDependency
|
||||
dependency14.from=Spike
|
||||
dependency14.to=GameOverWorld
|
||||
dependency14.from=MyWorld
|
||||
dependency14.to=TargetingProjectile
|
||||
dependency14.type=UsesDependency
|
||||
dependency15.from=Spike
|
||||
dependency15.to=MyWorld
|
||||
dependency15.to=GameOverWorld
|
||||
dependency15.type=UsesDependency
|
||||
dependency16.from=Spike
|
||||
dependency16.to=Player
|
||||
dependency16.to=MyWorld
|
||||
dependency16.type=UsesDependency
|
||||
dependency17.from=Player
|
||||
dependency17.to=GameOverWorld
|
||||
dependency17.from=Spike
|
||||
dependency17.to=Player
|
||||
dependency17.type=UsesDependency
|
||||
dependency18.from=Player
|
||||
dependency18.to=Plattform
|
||||
dependency18.to=GameOverWorld
|
||||
dependency18.type=UsesDependency
|
||||
dependency19.from=Player
|
||||
dependency19.to=PlayerProjectile
|
||||
dependency19.to=Plattform
|
||||
dependency19.type=UsesDependency
|
||||
dependency2.from=PlayerTestWorld
|
||||
dependency2.to=Ground
|
||||
dependency2.type=UsesDependency
|
||||
dependency20.from=Player
|
||||
dependency20.to=Projectile
|
||||
dependency20.to=PlayerProjectile
|
||||
dependency20.type=UsesDependency
|
||||
dependency21.from=Player
|
||||
dependency21.to=Enemy
|
||||
dependency21.to=Projectile
|
||||
dependency21.type=UsesDependency
|
||||
dependency22.from=UnactiveSpike
|
||||
dependency22.to=SpikedPlattform
|
||||
dependency22.from=Player
|
||||
dependency22.to=Enemy
|
||||
dependency22.type=UsesDependency
|
||||
dependency23.from=UnactiveSpike
|
||||
dependency23.to=MyWorld
|
||||
dependency23.from=Player
|
||||
dependency23.to=Spike
|
||||
dependency23.type=UsesDependency
|
||||
dependency24.from=UnactiveSpike
|
||||
dependency24.to=Spike
|
||||
dependency24.from=Player
|
||||
dependency24.to=Heart
|
||||
dependency24.type=UsesDependency
|
||||
dependency25.from=Plattform
|
||||
dependency25.to=MyWorld
|
||||
dependency25.from=UnactiveSpike
|
||||
dependency25.to=SpikedPlattform
|
||||
dependency25.type=UsesDependency
|
||||
dependency26.from=Plattform
|
||||
dependency26.to=Player
|
||||
dependency26.from=UnactiveSpike
|
||||
dependency26.to=MyWorld
|
||||
dependency26.type=UsesDependency
|
||||
dependency27.from=MovingPlattform
|
||||
dependency27.to=MyWorld
|
||||
dependency27.from=UnactiveSpike
|
||||
dependency27.to=Spike
|
||||
dependency27.type=UsesDependency
|
||||
dependency28.from=MovingPlattform
|
||||
dependency28.to=Player
|
||||
dependency28.from=Plattform
|
||||
dependency28.to=MyWorld
|
||||
dependency28.type=UsesDependency
|
||||
dependency29.from=SpikedPlattform
|
||||
dependency29.to=Spike
|
||||
dependency29.from=Plattform
|
||||
dependency29.to=Player
|
||||
dependency29.type=UsesDependency
|
||||
dependency3.from=PlayerTestWorld
|
||||
dependency3.to=Player
|
||||
dependency3.type=UsesDependency
|
||||
dependency30.from=SpikedPlattform
|
||||
dependency30.to=GameOverWorld
|
||||
dependency30.from=MovingPlattform
|
||||
dependency30.to=MyWorld
|
||||
dependency30.type=UsesDependency
|
||||
dependency31.from=SpikedPlattform
|
||||
dependency31.to=MyWorld
|
||||
dependency31.from=MovingPlattform
|
||||
dependency31.to=Player
|
||||
dependency31.type=UsesDependency
|
||||
dependency32.from=SpikedPlattform
|
||||
dependency32.to=UnactiveSpike
|
||||
dependency32.to=Spike
|
||||
dependency32.type=UsesDependency
|
||||
dependency33.from=TargetingProjectile
|
||||
dependency33.to=Player
|
||||
dependency33.from=SpikedPlattform
|
||||
dependency33.to=GameOverWorld
|
||||
dependency33.type=UsesDependency
|
||||
dependency34.from=Button
|
||||
dependency34.from=SpikedPlattform
|
||||
dependency34.to=MyWorld
|
||||
dependency34.type=UsesDependency
|
||||
dependency35.from=PowerUps
|
||||
dependency35.to=Player
|
||||
dependency35.from=SpikedPlattform
|
||||
dependency35.to=UnactiveSpike
|
||||
dependency35.type=UsesDependency
|
||||
dependency36.from=JumpBoostItem
|
||||
dependency36.from=TargetingProjectile
|
||||
dependency36.to=Player
|
||||
dependency36.type=UsesDependency
|
||||
dependency37.from=Enemy
|
||||
dependency37.to=Player
|
||||
dependency37.from=Button
|
||||
dependency37.to=MyWorld
|
||||
dependency37.type=UsesDependency
|
||||
dependency38.from=Enemy
|
||||
dependency38.to=EnemyProjectile
|
||||
dependency38.from=PowerUps
|
||||
dependency38.to=Player
|
||||
dependency38.type=UsesDependency
|
||||
dependency39.from=PlayerProjectile
|
||||
dependency39.to=Enemy
|
||||
dependency39.from=JumpBoostItem
|
||||
dependency39.to=Player
|
||||
dependency39.type=UsesDependency
|
||||
dependency4.from=PlayerTestWorld
|
||||
dependency4.to=JumpBoostItem
|
||||
dependency4.type=UsesDependency
|
||||
dependency40.from=Enemy
|
||||
dependency40.to=Player
|
||||
dependency40.type=UsesDependency
|
||||
dependency41.from=Enemy
|
||||
dependency41.to=EnemyProjectile
|
||||
dependency41.type=UsesDependency
|
||||
dependency42.from=PlayerProjectile
|
||||
dependency42.to=Enemy
|
||||
dependency42.type=UsesDependency
|
||||
dependency5.from=StartWorld
|
||||
dependency5.to=Button
|
||||
dependency5.type=UsesDependency
|
||||
@@ -129,15 +139,15 @@ dependency8.from=MyWorld
|
||||
dependency8.to=Plattform
|
||||
dependency8.type=UsesDependency
|
||||
dependency9.from=MyWorld
|
||||
dependency9.to=MovingPlattform
|
||||
dependency9.to=Heart
|
||||
dependency9.type=UsesDependency
|
||||
editor.fx.0.height=737
|
||||
editor.fx.0.width=814
|
||||
editor.fx.0.x=754
|
||||
editor.fx.0.y=45
|
||||
editor.fx.0.x=535
|
||||
editor.fx.0.y=44
|
||||
height=830
|
||||
package.numDependencies=39
|
||||
package.numTargets=21
|
||||
package.numDependencies=42
|
||||
package.numTargets=22
|
||||
project.charset=UTF-8
|
||||
publish.hasSource=false
|
||||
publish.locked=true
|
||||
@@ -160,140 +170,147 @@ target1.width=120
|
||||
target1.x=0
|
||||
target1.y=0
|
||||
target10.height=70
|
||||
target10.name=StartWorld
|
||||
target10.name=PlayerTestWorld
|
||||
target10.showInterface=false
|
||||
target10.type=ClassTarget
|
||||
target10.width=120
|
||||
target10.x=0
|
||||
target10.y=0
|
||||
target11.height=70
|
||||
target11.name=Plattform
|
||||
target11.name=StartWorld
|
||||
target11.showInterface=false
|
||||
target11.type=ClassTarget
|
||||
target11.width=120
|
||||
target11.x=0
|
||||
target11.y=0
|
||||
target12.height=70
|
||||
target12.name=TargetingProjectile
|
||||
target12.name=Plattform
|
||||
target12.showInterface=false
|
||||
target12.type=ClassTarget
|
||||
target12.width=120
|
||||
target12.x=0
|
||||
target12.y=0
|
||||
target13.height=70
|
||||
target13.name=Projectile
|
||||
target13.name=TargetingProjectile
|
||||
target13.showInterface=false
|
||||
target13.type=ClassTarget
|
||||
target13.width=120
|
||||
target13.x=0
|
||||
target13.y=0
|
||||
target14.height=70
|
||||
target14.name=Score
|
||||
target14.name=Projectile
|
||||
target14.showInterface=false
|
||||
target14.type=ClassTarget
|
||||
target14.width=120
|
||||
target14.x=0
|
||||
target14.y=0
|
||||
target15.height=70
|
||||
target15.name=Button
|
||||
target15.name=Score
|
||||
target15.showInterface=false
|
||||
target15.type=ClassTarget
|
||||
target15.width=120
|
||||
target15.x=0
|
||||
target15.y=0
|
||||
target16.height=70
|
||||
target16.name=EnemyProjectile
|
||||
target16.name=Button
|
||||
target16.showInterface=false
|
||||
target16.type=ClassTarget
|
||||
target16.width=120
|
||||
target16.x=0
|
||||
target16.y=0
|
||||
target17.height=70
|
||||
target17.name=PowerUps
|
||||
target17.name=EnemyProjectile
|
||||
target17.showInterface=false
|
||||
target17.type=ClassTarget
|
||||
target17.width=120
|
||||
target17.x=0
|
||||
target17.y=0
|
||||
target18.height=70
|
||||
target18.name=Enemy
|
||||
target18.name=PowerUps
|
||||
target18.showInterface=false
|
||||
target18.type=ClassTarget
|
||||
target18.width=120
|
||||
target18.x=0
|
||||
target18.y=0
|
||||
target19.height=70
|
||||
target19.name=PlayerProjectile
|
||||
target19.name=Enemy
|
||||
target19.showInterface=false
|
||||
target19.type=ClassTarget
|
||||
target19.width=120
|
||||
target19.x=0
|
||||
target19.y=0
|
||||
target2.height=70
|
||||
target2.name=Player
|
||||
target2.name=Heart
|
||||
target2.showInterface=false
|
||||
target2.type=ClassTarget
|
||||
target2.width=120
|
||||
target2.x=0
|
||||
target2.y=0
|
||||
target20.height=70
|
||||
target20.name=SpikedPlattform
|
||||
target20.name=PlayerProjectile
|
||||
target20.showInterface=false
|
||||
target20.type=ClassTarget
|
||||
target20.width=120
|
||||
target20.x=0
|
||||
target20.y=0
|
||||
target21.height=70
|
||||
target21.name=MyWorld
|
||||
target21.name=SpikedPlattform
|
||||
target21.showInterface=false
|
||||
target21.type=ClassTarget
|
||||
target21.width=120
|
||||
target21.x=0
|
||||
target21.y=0
|
||||
target22.height=70
|
||||
target22.name=MyWorld
|
||||
target22.showInterface=false
|
||||
target22.type=ClassTarget
|
||||
target22.width=120
|
||||
target22.x=0
|
||||
target22.y=0
|
||||
target3.height=70
|
||||
target3.name=MovingPlattform
|
||||
target3.name=Player
|
||||
target3.showInterface=false
|
||||
target3.type=ClassTarget
|
||||
target3.width=120
|
||||
target3.x=0
|
||||
target3.y=0
|
||||
target4.height=70
|
||||
target4.name=Ground
|
||||
target4.name=MovingPlattform
|
||||
target4.showInterface=false
|
||||
target4.type=ClassTarget
|
||||
target4.width=120
|
||||
target4.x=0
|
||||
target4.y=0
|
||||
target5.height=70
|
||||
target5.name=UnactiveSpike
|
||||
target5.name=Ground
|
||||
target5.showInterface=false
|
||||
target5.type=ClassTarget
|
||||
target5.width=120
|
||||
target5.x=0
|
||||
target5.y=0
|
||||
target6.height=70
|
||||
target6.name=JumpBoostItem
|
||||
target6.name=UnactiveSpike
|
||||
target6.showInterface=false
|
||||
target6.type=ClassTarget
|
||||
target6.width=120
|
||||
target6.x=0
|
||||
target6.y=0
|
||||
target7.height=70
|
||||
target7.name=BreakingPlattform
|
||||
target7.name=JumpBoostItem
|
||||
target7.showInterface=false
|
||||
target7.type=ClassTarget
|
||||
target7.width=120
|
||||
target7.x=0
|
||||
target7.y=0
|
||||
target8.height=70
|
||||
target8.name=GameOverWorld
|
||||
target8.name=BreakingPlattform
|
||||
target8.showInterface=false
|
||||
target8.type=ClassTarget
|
||||
target8.width=120
|
||||
target8.x=0
|
||||
target8.y=0
|
||||
target9.height=70
|
||||
target9.name=PlayerTestWorld
|
||||
target9.name=GameOverWorld
|
||||
target9.showInterface=false
|
||||
target9.type=ClassTarget
|
||||
target9.width=120
|
||||
@@ -301,6 +318,6 @@ target9.x=0
|
||||
target9.y=0
|
||||
version=3.1.0
|
||||
width=1550
|
||||
world.lastInstantiated=MyWorld
|
||||
world.lastInstantiated=StartWorld
|
||||
xPosition=0
|
||||
yPosition=0
|
||||
|
||||
Reference in New Issue
Block a user