Fix Health

This commit is contained in:
2026-09-16 17:26:16 +02:00
parent eba1e4567e
commit f7f611c2ae
3 changed files with 138 additions and 129 deletions
Binary file not shown.
-5
View File
@@ -124,11 +124,6 @@ public class Player extends Actor
public void checkHealth(){ public void checkHealth(){
if (health <= 0){ if (health <= 0){
Greenfoot.setWorld(new GameOverWorld()); Greenfoot.setWorld(new GameOverWorld());
return true;
}
else
{
return false;
} }
} }
+132 -118
View File
@@ -1,153 +1,153 @@
#Greenfoot project file #Greenfoot project file
class.BreakingPlattform.image=Unbenannt2.png class.BreakingPlattform.image=Unbenannt2.png
class.Button.image=button-red.png
class.GameOverWorld.image=GameOverBackground.png
class.Ground.image=weave.jpg class.Ground.image=weave.jpg
class.HealthItem.image=herz.png class.Groundflower.image=beeper.png
class.JumpBoostItem.image=mushroom.png
class.MovingPlattform.image=Unbenannt.png class.MovingPlattform.image=Unbenannt.png
class.MyWorld.image=GameBackground.png class.Plattform.image=Plattform.png
class.Plattform.image=Platform1.png class.Player.image=ppl2.png
class.Player.image=Player.png
class.Projectile.image=Projectile1.png
class.Spike.image=Spike.png class.Spike.image=Spike.png
class.SpikedPlattform.image=SpikedPlattform.png class.SpikedPlattform.image=SpikedPlattform.png
class.StartWorld.image=StartBackground.png class.TemporaryGround.image=TemporaryGround.png
class.TargetingProjectile.image=blue-draught.png class.UnactiveSpike.image=Spike_Copy.png
class.UnactiveSpike.image=SpikeUnactive.png dependency1.from=PlayerTestWorld
dependency1.from=GameOverWorld dependency1.to=Ground
dependency1.to=Button
dependency1.type=UsesDependency dependency1.type=UsesDependency
dependency10.from=MyWorld dependency10.from=MyWorld
dependency10.to=MovingPlattform dependency10.to=SpikedPlattform
dependency10.type=UsesDependency dependency10.type=UsesDependency
dependency11.from=MyWorld dependency11.from=MyWorld
dependency11.to=BreakingPlattform dependency11.to=Projectile
dependency11.type=UsesDependency dependency11.type=UsesDependency
dependency12.from=MyWorld dependency12.from=MyWorld
dependency12.to=SpikedPlattform dependency12.to=TargetingProjectile
dependency12.type=UsesDependency dependency12.type=UsesDependency
dependency13.from=MyWorld dependency13.from=GameOverWorld
dependency13.to=Projectile dependency13.to=Button
dependency13.type=UsesDependency dependency13.type=UsesDependency
dependency14.from=MyWorld dependency14.from=StartWorld
dependency14.to=TargetingProjectile dependency14.to=Button
dependency14.type=UsesDependency dependency14.type=UsesDependency
dependency15.from=Spike dependency15.from=UnactiveSpike
dependency15.to=GameOverWorld dependency15.to=SpikedPlattform
dependency15.type=UsesDependency dependency15.type=UsesDependency
dependency16.from=Spike dependency16.from=UnactiveSpike
dependency16.to=MyWorld dependency16.to=MyWorld
dependency16.type=UsesDependency dependency16.type=UsesDependency
dependency17.from=Spike dependency17.from=UnactiveSpike
dependency17.to=Player dependency17.to=Spike
dependency17.type=UsesDependency dependency17.type=UsesDependency
dependency18.from=Player dependency18.from=Button
dependency18.to=GameOverWorld dependency18.to=MyWorld
dependency18.type=UsesDependency dependency18.type=UsesDependency
dependency19.from=Player dependency19.from=PowerUps
dependency19.to=Plattform dependency19.to=Player
dependency19.type=UsesDependency dependency19.type=UsesDependency
dependency2.from=PlayerTestWorld dependency2.from=PlayerTestWorld
dependency2.to=Ground dependency2.to=Player
dependency2.type=UsesDependency dependency2.type=UsesDependency
dependency20.from=Player dependency20.from=HealthItem
dependency20.to=PlayerProjectile dependency20.to=Player
dependency20.type=UsesDependency dependency20.type=UsesDependency
dependency21.from=Player dependency21.from=JumpBoostItem
dependency21.to=Projectile dependency21.to=Player
dependency21.type=UsesDependency dependency21.type=UsesDependency
dependency22.from=Player dependency22.from=Groundflower
dependency22.to=Enemy dependency22.to=Player
dependency22.type=UsesDependency dependency22.type=UsesDependency
dependency23.from=UnactiveSpike dependency23.from=Enemy
dependency23.to=SpikedPlattform dependency23.to=Player
dependency23.type=UsesDependency dependency23.type=UsesDependency
dependency24.from=UnactiveSpike dependency24.from=Enemy
dependency24.to=MyWorld dependency24.to=EnemyProjectile
dependency24.type=UsesDependency dependency24.type=UsesDependency
dependency25.from=UnactiveSpike dependency25.from=Spike
dependency25.to=Spike dependency25.to=GameOverWorld
dependency25.type=UsesDependency dependency25.type=UsesDependency
dependency26.from=Healthbar dependency26.from=Spike
dependency26.to=Player dependency26.to=MyWorld
dependency26.type=UsesDependency dependency26.type=UsesDependency
dependency27.from=Plattform dependency27.from=Spike
dependency27.to=MyWorld dependency27.to=Player
dependency27.type=UsesDependency dependency27.type=UsesDependency
dependency28.from=Plattform dependency28.from=Player
dependency28.to=Player dependency28.to=GameOverWorld
dependency28.type=UsesDependency dependency28.type=UsesDependency
dependency29.from=MovingPlattform dependency29.from=Player
dependency29.to=MyWorld dependency29.to=Plattform
dependency29.type=UsesDependency dependency29.type=UsesDependency
dependency3.from=PlayerTestWorld dependency3.from=PlayerTestWorld
dependency3.to=Player dependency3.to=JumpBoostItem
dependency3.type=UsesDependency dependency3.type=UsesDependency
dependency30.from=MovingPlattform dependency30.from=Player
dependency30.to=Player dependency30.to=PlayerProjectile
dependency30.type=UsesDependency dependency30.type=UsesDependency
dependency31.from=SpikedPlattform dependency31.from=Player
dependency31.to=Spike dependency31.to=TemporaryGround
dependency31.type=UsesDependency dependency31.type=UsesDependency
dependency32.from=SpikedPlattform dependency32.from=Player
dependency32.to=GameOverWorld dependency32.to=Projectile
dependency32.type=UsesDependency dependency32.type=UsesDependency
dependency33.from=SpikedPlattform dependency33.from=Player
dependency33.to=MyWorld dependency33.to=Enemy
dependency33.type=UsesDependency dependency33.type=UsesDependency
dependency34.from=SpikedPlattform dependency34.from=Healthbar
dependency34.to=UnactiveSpike dependency34.to=Player
dependency34.type=UsesDependency dependency34.type=UsesDependency
dependency35.from=TargetingProjectile dependency35.from=Plattform
dependency35.to=Player dependency35.to=MyWorld
dependency35.type=UsesDependency dependency35.type=UsesDependency
dependency36.from=Button dependency36.from=Plattform
dependency36.to=MyWorld dependency36.to=Player
dependency36.type=UsesDependency dependency36.type=UsesDependency
dependency37.from=PowerUps dependency37.from=MovingPlattform
dependency37.to=Player dependency37.to=MyWorld
dependency37.type=UsesDependency dependency37.type=UsesDependency
dependency38.from=HealthItem dependency38.from=MovingPlattform
dependency38.to=Player dependency38.to=Player
dependency38.type=UsesDependency dependency38.type=UsesDependency
dependency39.from=JumpBoostItem dependency39.from=SpikedPlattform
dependency39.to=Player dependency39.to=Spike
dependency39.type=UsesDependency dependency39.type=UsesDependency
dependency4.from=PlayerTestWorld dependency4.from=MyWorld
dependency4.to=JumpBoostItem dependency4.to=Player
dependency4.type=UsesDependency dependency4.type=UsesDependency
dependency40.from=Enemy dependency40.from=SpikedPlattform
dependency40.to=Player dependency40.to=GameOverWorld
dependency40.type=UsesDependency dependency40.type=UsesDependency
dependency41.from=Enemy dependency41.from=SpikedPlattform
dependency41.to=EnemyProjectile dependency41.to=MyWorld
dependency41.type=UsesDependency dependency41.type=UsesDependency
dependency42.from=PlayerProjectile dependency42.from=SpikedPlattform
dependency42.to=Enemy dependency42.to=UnactiveSpike
dependency42.type=UsesDependency dependency42.type=UsesDependency
dependency5.from=StartWorld dependency43.from=TargetingProjectile
dependency5.to=Button dependency43.to=Player
dependency43.type=UsesDependency
dependency44.from=PlayerProjectile
dependency44.to=Enemy
dependency44.type=UsesDependency
dependency5.from=MyWorld
dependency5.to=Score
dependency5.type=UsesDependency dependency5.type=UsesDependency
dependency6.from=MyWorld dependency6.from=MyWorld
dependency6.to=Player dependency6.to=Plattform
dependency6.type=UsesDependency dependency6.type=UsesDependency
dependency7.from=MyWorld dependency7.from=MyWorld
dependency7.to=Score dependency7.to=Healthbar
dependency7.type=UsesDependency dependency7.type=UsesDependency
dependency8.from=MyWorld dependency8.from=MyWorld
dependency8.to=Plattform dependency8.to=MovingPlattform
dependency8.type=UsesDependency dependency8.type=UsesDependency
dependency9.from=MyWorld dependency9.from=MyWorld
dependency9.to=Healthbar dependency9.to=BreakingPlattform
dependency9.type=UsesDependency dependency9.type=UsesDependency
editor.fx.0.height=737 editor.fx.0.height=739
editor.fx.0.width=814 editor.fx.0.width=816
editor.fx.0.x=360 editor.fx.0.x=552
editor.fx.0.y=26 editor.fx.0.y=98
height=822 height=1048
package.numDependencies=42 package.numDependencies=44
package.numTargets=23 package.numTargets=25
project.charset=UTF-8 project.charset=UTF-8
publish.hasSource=false publish.hasSource=false
publish.locked=true publish.locked=true
@@ -163,168 +163,182 @@ readme.x=10
readme.y=10 readme.y=10
simulation.speed=50 simulation.speed=50
target1.height=70 target1.height=70
target1.name=Spike target1.name=MovingPlattform
target1.showInterface=false target1.showInterface=false
target1.type=ClassTarget target1.type=ClassTarget
target1.width=120 target1.width=120
target1.x=0 target1.x=0
target1.y=0 target1.y=0
target10.height=70 target10.height=70
target10.name=GameOverWorld target10.name=PowerUps
target10.showInterface=false target10.showInterface=false
target10.type=ClassTarget target10.type=ClassTarget
target10.width=120 target10.width=120
target10.x=0 target10.x=0
target10.y=0 target10.y=0
target11.height=70 target11.height=70
target11.name=PlayerTestWorld target11.name=Enemy
target11.showInterface=false target11.showInterface=false
target11.type=ClassTarget target11.type=ClassTarget
target11.width=120 target11.width=120
target11.x=0 target11.x=0
target11.y=0 target11.y=0
target12.height=70 target12.height=70
target12.name=StartWorld target12.name=MyWorld
target12.showInterface=false target12.showInterface=false
target12.type=ClassTarget target12.type=ClassTarget
target12.width=120 target12.width=120
target12.x=0 target12.x=0
target12.y=0 target12.y=0
target13.height=70 target13.height=70
target13.name=Plattform target13.name=Spike
target13.showInterface=false target13.showInterface=false
target13.type=ClassTarget target13.type=ClassTarget
target13.width=120 target13.width=120
target13.x=0 target13.x=0
target13.y=0 target13.y=0
target14.height=70 target14.height=70
target14.name=TargetingProjectile target14.name=Groundflower
target14.showInterface=false target14.showInterface=false
target14.type=ClassTarget target14.type=ClassTarget
target14.width=120 target14.width=120
target14.x=0 target14.x=0
target14.y=0 target14.y=0
target15.height=70 target15.height=70
target15.name=Projectile target15.name=Player
target15.showInterface=false target15.showInterface=false
target15.type=ClassTarget target15.type=ClassTarget
target15.width=120 target15.width=120
target15.x=0 target15.x=0
target15.y=0 target15.y=0
target16.height=70 target16.height=70
target16.name=Score target16.name=Healthbar
target16.showInterface=false target16.showInterface=false
target16.type=ClassTarget target16.type=ClassTarget
target16.width=120 target16.width=120
target16.x=0 target16.x=0
target16.y=0 target16.y=0
target17.height=70 target17.height=70
target17.name=Button target17.name=BreakingPlattform
target17.showInterface=false target17.showInterface=false
target17.type=ClassTarget target17.type=ClassTarget
target17.width=120 target17.width=120
target17.x=0 target17.x=0
target17.y=0 target17.y=0
target18.height=70 target18.height=70
target18.name=EnemyProjectile target18.name=GameOverWorld
target18.showInterface=false target18.showInterface=false
target18.type=ClassTarget target18.type=ClassTarget
target18.width=120 target18.width=120
target18.x=0 target18.x=0
target18.y=0 target18.y=0
target19.height=70 target19.height=70
target19.name=PowerUps target19.name=StartWorld
target19.showInterface=false target19.showInterface=false
target19.type=ClassTarget target19.type=ClassTarget
target19.width=120 target19.width=120
target19.x=0 target19.x=0
target19.y=0 target19.y=0
target2.height=70 target2.height=70
target2.name=Player target2.name=Ground
target2.showInterface=false target2.showInterface=false
target2.type=ClassTarget target2.type=ClassTarget
target2.width=120 target2.width=120
target2.x=0 target2.x=0
target2.y=0 target2.y=0
target20.height=70 target20.height=70
target20.name=Enemy target20.name=Plattform
target20.showInterface=false target20.showInterface=false
target20.type=ClassTarget target20.type=ClassTarget
target20.width=120 target20.width=120
target20.x=0 target20.x=0
target20.y=0 target20.y=0
target21.height=70 target21.height=70
target21.name=PlayerProjectile target21.name=Projectile
target21.showInterface=false target21.showInterface=false
target21.type=ClassTarget target21.type=ClassTarget
target21.width=120 target21.width=120
target21.x=0 target21.x=0
target21.y=0 target21.y=0
target22.height=70 target22.height=70
target22.name=SpikedPlattform target22.name=Score
target22.showInterface=false target22.showInterface=false
target22.type=ClassTarget target22.type=ClassTarget
target22.width=120 target22.width=120
target22.x=0 target22.x=0
target22.y=0 target22.y=0
target23.height=70 target23.height=70
target23.name=MyWorld target23.name=EnemyProjectile
target23.showInterface=false target23.showInterface=false
target23.type=ClassTarget target23.type=ClassTarget
target23.width=120 target23.width=120
target23.x=0 target23.x=0
target23.y=0 target23.y=0
target24.height=70
target24.name=PlayerProjectile
target24.showInterface=false
target24.type=ClassTarget
target24.width=120
target24.x=0
target24.y=0
target25.height=70
target25.name=SpikedPlattform
target25.showInterface=false
target25.type=ClassTarget
target25.width=120
target25.x=0
target25.y=0
target3.height=70 target3.height=70
target3.name=MovingPlattform target3.name=HealthItem
target3.showInterface=false target3.showInterface=false
target3.type=ClassTarget target3.type=ClassTarget
target3.width=120 target3.width=120
target3.x=0 target3.x=0
target3.y=0 target3.y=0
target4.height=70 target4.height=70
target4.name=Ground target4.name=UnactiveSpike
target4.showInterface=false target4.showInterface=false
target4.type=ClassTarget target4.type=ClassTarget
target4.width=120 target4.width=120
target4.x=0 target4.x=0
target4.y=0 target4.y=0
target5.height=70 target5.height=70
target5.name=UnactiveSpike target5.name=JumpBoostItem
target5.showInterface=false target5.showInterface=false
target5.type=ClassTarget target5.type=ClassTarget
target5.width=120 target5.width=120
target5.x=0 target5.x=0
target5.y=0 target5.y=0
target6.height=70 target6.height=70
target6.name=HealthItem target6.name=PlayerTestWorld
target6.showInterface=false target6.showInterface=false
target6.type=ClassTarget target6.type=ClassTarget
target6.width=120 target6.width=120
target6.x=0 target6.x=0
target6.y=0 target6.y=0
target7.height=70 target7.height=70
target7.name=Healthbar target7.name=TargetingProjectile
target7.showInterface=false target7.showInterface=false
target7.type=ClassTarget target7.type=ClassTarget
target7.width=120 target7.width=120
target7.x=0 target7.x=0
target7.y=0 target7.y=0
target8.height=70 target8.height=70
target8.name=JumpBoostItem target8.name=TemporaryGround
target8.showInterface=false target8.showInterface=false
target8.type=ClassTarget target8.type=ClassTarget
target8.width=120 target8.width=120
target8.x=0 target8.x=0
target8.y=0 target8.y=0
target9.height=70 target9.height=70
target9.name=BreakingPlattform target9.name=Button
target9.showInterface=false target9.showInterface=false
target9.type=ClassTarget target9.type=ClassTarget
target9.width=120 target9.width=120
target9.x=0 target9.x=0
target9.y=0 target9.y=0
version=3.1.0 version=3.1.0
width=715 width=1936
world.lastInstantiated=MyWorld world.lastInstantiated=StartWorld
xPosition=532 xPosition=0
yPosition=117 yPosition=0