Fix: Game Crashed nicht mehr wenn das PlayerProjectile das Fenster verlässt
This commit is contained in:
Binary file not shown.
@@ -15,10 +15,10 @@ public class PlayerProjectile extends Actor
|
|||||||
public void act()
|
public void act()
|
||||||
{
|
{
|
||||||
move(7);
|
move(7);
|
||||||
|
checkForEnemyCollision();
|
||||||
if (!isProjectileOnScreen()){
|
if (!isProjectileOnScreen()){
|
||||||
getWorld().removeObject(this);
|
getWorld().removeObject(this);
|
||||||
}
|
}
|
||||||
checkForEnemyCollision();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkForEnemyCollision(){
|
public void checkForEnemyCollision(){
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#Greenfoot project file
|
#Greenfoot project file
|
||||||
class.BreakingPlattform.image=Unbenannt2.png
|
class.BreakingPlattform.image=Unbenannt2.png
|
||||||
class.Button.image=button-red.png
|
class.Button.image=button-red.png
|
||||||
|
class.Enemy.image=bee.png
|
||||||
|
class.EnemyProjectile.image=yellow-draught.png
|
||||||
class.GameOverWorld.image=GameOverBackground.png
|
class.GameOverWorld.image=GameOverBackground.png
|
||||||
class.Ground.image=weave.jpg
|
class.Ground.image=weave.jpg
|
||||||
class.JumpBoostItem.image=mushroom.png
|
class.JumpBoostItem.image=mushroom.png
|
||||||
@@ -8,12 +10,13 @@ class.MovingPlattform.image=Unbenannt.png
|
|||||||
class.MyWorld.image=GameBackground.png
|
class.MyWorld.image=GameBackground.png
|
||||||
class.Plattform.image=Plattform.png
|
class.Plattform.image=Plattform.png
|
||||||
class.Player.image=ppl2.png
|
class.Player.image=ppl2.png
|
||||||
|
class.PlayerProjectile.image=beeper.png
|
||||||
class.Projectile.image=Projectile1.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.StartWorld.image=StartBackground.png
|
||||||
class.TargetingProjectile.image=blue-draught.png
|
class.TargetingProjectile.image=blue-draught.png
|
||||||
class.UnactiveSpike.image=SpikeUnactive.png
|
class.UnactiveSpike.image=Spike_Copy.png
|
||||||
dependency1.from=GameOverWorld
|
dependency1.from=GameOverWorld
|
||||||
dependency1.to=Button
|
dependency1.to=Button
|
||||||
dependency1.type=UsesDependency
|
dependency1.type=UsesDependency
|
||||||
@@ -21,62 +24,98 @@ dependency10.from=MyWorld
|
|||||||
dependency10.to=BreakingPlattform
|
dependency10.to=BreakingPlattform
|
||||||
dependency10.type=UsesDependency
|
dependency10.type=UsesDependency
|
||||||
dependency11.from=MyWorld
|
dependency11.from=MyWorld
|
||||||
dependency11.to=Projectile
|
dependency11.to=SpikedPlattform
|
||||||
dependency11.type=UsesDependency
|
dependency11.type=UsesDependency
|
||||||
dependency12.from=MyWorld
|
dependency12.from=MyWorld
|
||||||
dependency12.to=TargetingProjectile
|
dependency12.to=Projectile
|
||||||
dependency12.type=UsesDependency
|
dependency12.type=UsesDependency
|
||||||
dependency13.from=Spike
|
dependency13.from=MyWorld
|
||||||
dependency13.to=GameOverWorld
|
dependency13.to=TargetingProjectile
|
||||||
dependency13.type=UsesDependency
|
dependency13.type=UsesDependency
|
||||||
dependency14.from=Spike
|
dependency14.from=Spike
|
||||||
dependency14.to=Player
|
dependency14.to=GameOverWorld
|
||||||
dependency14.type=UsesDependency
|
dependency14.type=UsesDependency
|
||||||
dependency15.from=Player
|
dependency15.from=Spike
|
||||||
dependency15.to=GameOverWorld
|
dependency15.to=MyWorld
|
||||||
dependency15.type=UsesDependency
|
dependency15.type=UsesDependency
|
||||||
dependency16.from=Player
|
dependency16.from=Spike
|
||||||
dependency16.to=Plattform
|
dependency16.to=Player
|
||||||
dependency16.type=UsesDependency
|
dependency16.type=UsesDependency
|
||||||
dependency17.from=Player
|
dependency17.from=Player
|
||||||
dependency17.to=Projectile
|
dependency17.to=GameOverWorld
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=Plattform
|
dependency18.from=Player
|
||||||
dependency18.to=MyWorld
|
dependency18.to=Plattform
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=Plattform
|
dependency19.from=Player
|
||||||
dependency19.to=Player
|
dependency19.to=PlayerProjectile
|
||||||
dependency19.type=UsesDependency
|
dependency19.type=UsesDependency
|
||||||
dependency2.from=PlayerTestWorld
|
dependency2.from=PlayerTestWorld
|
||||||
dependency2.to=Ground
|
dependency2.to=Ground
|
||||||
dependency2.type=UsesDependency
|
dependency2.type=UsesDependency
|
||||||
dependency20.from=MovingPlattform
|
dependency20.from=Player
|
||||||
dependency20.to=MyWorld
|
dependency20.to=Projectile
|
||||||
dependency20.type=UsesDependency
|
dependency20.type=UsesDependency
|
||||||
dependency21.from=SpikedPlattform
|
dependency21.from=Player
|
||||||
dependency21.to=Spike
|
dependency21.to=Enemy
|
||||||
dependency21.type=UsesDependency
|
dependency21.type=UsesDependency
|
||||||
dependency22.from=SpikedPlattform
|
dependency22.from=UnactiveSpike
|
||||||
dependency22.to=GameOverWorld
|
dependency22.to=SpikedPlattform
|
||||||
dependency22.type=UsesDependency
|
dependency22.type=UsesDependency
|
||||||
dependency23.from=SpikedPlattform
|
dependency23.from=UnactiveSpike
|
||||||
dependency23.to=MyWorld
|
dependency23.to=MyWorld
|
||||||
dependency23.type=UsesDependency
|
dependency23.type=UsesDependency
|
||||||
dependency24.from=TargetingProjectile
|
dependency24.from=UnactiveSpike
|
||||||
dependency24.to=Player
|
dependency24.to=Spike
|
||||||
dependency24.type=UsesDependency
|
dependency24.type=UsesDependency
|
||||||
dependency25.from=Button
|
dependency25.from=Plattform
|
||||||
dependency25.to=MyWorld
|
dependency25.to=MyWorld
|
||||||
dependency25.type=UsesDependency
|
dependency25.type=UsesDependency
|
||||||
dependency26.from=PowerUps
|
dependency26.from=Plattform
|
||||||
dependency26.to=Player
|
dependency26.to=Player
|
||||||
dependency26.type=UsesDependency
|
dependency26.type=UsesDependency
|
||||||
dependency27.from=JumpBoostItem
|
dependency27.from=MovingPlattform
|
||||||
dependency27.to=Player
|
dependency27.to=MyWorld
|
||||||
dependency27.type=UsesDependency
|
dependency27.type=UsesDependency
|
||||||
|
dependency28.from=MovingPlattform
|
||||||
|
dependency28.to=Player
|
||||||
|
dependency28.type=UsesDependency
|
||||||
|
dependency29.from=SpikedPlattform
|
||||||
|
dependency29.to=Spike
|
||||||
|
dependency29.type=UsesDependency
|
||||||
dependency3.from=PlayerTestWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=Player
|
dependency3.to=Player
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
|
dependency30.from=SpikedPlattform
|
||||||
|
dependency30.to=GameOverWorld
|
||||||
|
dependency30.type=UsesDependency
|
||||||
|
dependency31.from=SpikedPlattform
|
||||||
|
dependency31.to=MyWorld
|
||||||
|
dependency31.type=UsesDependency
|
||||||
|
dependency32.from=SpikedPlattform
|
||||||
|
dependency32.to=UnactiveSpike
|
||||||
|
dependency32.type=UsesDependency
|
||||||
|
dependency33.from=TargetingProjectile
|
||||||
|
dependency33.to=Player
|
||||||
|
dependency33.type=UsesDependency
|
||||||
|
dependency34.from=Button
|
||||||
|
dependency34.to=MyWorld
|
||||||
|
dependency34.type=UsesDependency
|
||||||
|
dependency35.from=PowerUps
|
||||||
|
dependency35.to=Player
|
||||||
|
dependency35.type=UsesDependency
|
||||||
|
dependency36.from=JumpBoostItem
|
||||||
|
dependency36.to=Player
|
||||||
|
dependency36.type=UsesDependency
|
||||||
|
dependency37.from=Enemy
|
||||||
|
dependency37.to=Player
|
||||||
|
dependency37.type=UsesDependency
|
||||||
|
dependency38.from=Enemy
|
||||||
|
dependency38.to=EnemyProjectile
|
||||||
|
dependency38.type=UsesDependency
|
||||||
|
dependency39.from=PlayerProjectile
|
||||||
|
dependency39.to=Enemy
|
||||||
|
dependency39.type=UsesDependency
|
||||||
dependency4.from=PlayerTestWorld
|
dependency4.from=PlayerTestWorld
|
||||||
dependency4.to=JumpBoostItem
|
dependency4.to=JumpBoostItem
|
||||||
dependency4.type=UsesDependency
|
dependency4.type=UsesDependency
|
||||||
@@ -99,9 +138,9 @@ editor.fx.0.height=737
|
|||||||
editor.fx.0.width=814
|
editor.fx.0.width=814
|
||||||
editor.fx.0.x=360
|
editor.fx.0.x=360
|
||||||
editor.fx.0.y=26
|
editor.fx.0.y=26
|
||||||
height=830
|
height=581
|
||||||
package.numDependencies=27
|
package.numDependencies=39
|
||||||
package.numTargets=18
|
package.numTargets=21
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
publish.locked=true
|
publish.locked=true
|
||||||
@@ -166,26 +205,33 @@ target15.width=120
|
|||||||
target15.x=0
|
target15.x=0
|
||||||
target15.y=0
|
target15.y=0
|
||||||
target16.height=70
|
target16.height=70
|
||||||
target16.name=PowerUps
|
target16.name=EnemyProjectile
|
||||||
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=SpikedPlattform
|
target17.name=PowerUps
|
||||||
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=MyWorld
|
target18.name=Enemy
|
||||||
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.name=PlayerProjectile
|
||||||
|
target19.showInterface=false
|
||||||
|
target19.type=ClassTarget
|
||||||
|
target19.width=120
|
||||||
|
target19.x=0
|
||||||
|
target19.y=0
|
||||||
target2.height=70
|
target2.height=70
|
||||||
target2.name=Player
|
target2.name=Player
|
||||||
target2.showInterface=false
|
target2.showInterface=false
|
||||||
@@ -193,6 +239,20 @@ 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.name=SpikedPlattform
|
||||||
|
target20.showInterface=false
|
||||||
|
target20.type=ClassTarget
|
||||||
|
target20.width=120
|
||||||
|
target20.x=0
|
||||||
|
target20.y=0
|
||||||
|
target21.height=70
|
||||||
|
target21.name=MyWorld
|
||||||
|
target21.showInterface=false
|
||||||
|
target21.type=ClassTarget
|
||||||
|
target21.width=120
|
||||||
|
target21.x=0
|
||||||
|
target21.y=0
|
||||||
target3.height=70
|
target3.height=70
|
||||||
target3.name=MovingPlattform
|
target3.name=MovingPlattform
|
||||||
target3.showInterface=false
|
target3.showInterface=false
|
||||||
@@ -246,4 +306,4 @@ version=3.1.0
|
|||||||
width=1550
|
width=1550
|
||||||
world.lastInstantiated=MyWorld
|
world.lastInstantiated=MyWorld
|
||||||
xPosition=0
|
xPosition=0
|
||||||
yPosition=0
|
yPosition=123
|
||||||
|
|||||||
Reference in New Issue
Block a user