Spikes machen jetzt damage statt zu gameOverWorld zu wechseln
This commit is contained in:
Binary file not shown.
@@ -112,11 +112,13 @@ public class Player extends Actor
|
|||||||
|
|
||||||
public void collision(){
|
public void collision(){
|
||||||
if (getIntersectingObjects(Projectile.class).size()>0
|
if (getIntersectingObjects(Projectile.class).size()>0
|
||||||
|| getIntersectingObjects(Enemy.class).size()>0)
|
|| getIntersectingObjects(Enemy.class).size()>0
|
||||||
|
|| getIntersectingObjects(Spike.class).size()>0)
|
||||||
{
|
{
|
||||||
health--;
|
health--;
|
||||||
getWorld().removeObjects(getIntersectingObjects(Projectile.class));
|
getWorld().removeObjects(getIntersectingObjects(Projectile.class));
|
||||||
getWorld().removeObjects(getIntersectingObjects(Enemy.class));
|
getWorld().removeObjects(getIntersectingObjects(Enemy.class));
|
||||||
|
getWorld().removeObjects(getIntersectingObjects(Spike.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -20,11 +20,6 @@ public class Spike extends Actor
|
|||||||
*/
|
*/
|
||||||
public void act()
|
public void act()
|
||||||
{
|
{
|
||||||
// Add your action code here.
|
|
||||||
if(this.isTouching(Player.class))
|
|
||||||
{
|
|
||||||
Greenfoot.setWorld(new GameOverWorld());
|
|
||||||
}
|
|
||||||
this.bewege();
|
this.bewege();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,56 +9,57 @@ class.MovingPlattform.image=Unbenannt.png
|
|||||||
class.MyWorld.image=GameBackground.png
|
class.MyWorld.image=GameBackground.png
|
||||||
class.Plattform.image=Platform1.png
|
class.Plattform.image=Platform1.png
|
||||||
class.Player.image=Player.png
|
class.Player.image=Player.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
|
||||||
dependency10.from=MyWorld
|
dependency10.from=MyWorld
|
||||||
dependency10.to=MovingPlattform
|
dependency10.to=BreakingPlattform
|
||||||
dependency10.type=UsesDependency
|
dependency10.type=UsesDependency
|
||||||
dependency11.from=MyWorld
|
dependency11.from=MyWorld
|
||||||
dependency11.to=BreakingPlattform
|
dependency11.to=SpikedPlattform
|
||||||
dependency11.type=UsesDependency
|
dependency11.type=UsesDependency
|
||||||
dependency12.from=MyWorld
|
dependency12.from=MyWorld
|
||||||
dependency12.to=SpikedPlattform
|
dependency12.to=Projectile
|
||||||
dependency12.type=UsesDependency
|
dependency12.type=UsesDependency
|
||||||
dependency13.from=MyWorld
|
dependency13.from=MyWorld
|
||||||
dependency13.to=Projectile
|
dependency13.to=TargetingProjectile
|
||||||
dependency13.type=UsesDependency
|
dependency13.type=UsesDependency
|
||||||
dependency14.from=MyWorld
|
dependency14.from=Spike
|
||||||
dependency14.to=TargetingProjectile
|
dependency14.to=GameOverWorld
|
||||||
dependency14.type=UsesDependency
|
dependency14.type=UsesDependency
|
||||||
dependency15.from=Spike
|
dependency15.from=Spike
|
||||||
dependency15.to=GameOverWorld
|
dependency15.to=MyWorld
|
||||||
dependency15.type=UsesDependency
|
dependency15.type=UsesDependency
|
||||||
dependency16.from=Spike
|
dependency16.from=Spike
|
||||||
dependency16.to=MyWorld
|
dependency16.to=Player
|
||||||
dependency16.type=UsesDependency
|
dependency16.type=UsesDependency
|
||||||
dependency17.from=Spike
|
dependency17.from=Player
|
||||||
dependency17.to=Player
|
dependency17.to=GameOverWorld
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=Player
|
dependency18.from=Player
|
||||||
dependency18.to=GameOverWorld
|
dependency18.to=Plattform
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=Player
|
dependency19.from=Player
|
||||||
dependency19.to=Plattform
|
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=Player
|
dependency20.from=Player
|
||||||
dependency20.to=PlayerProjectile
|
dependency20.to=Projectile
|
||||||
dependency20.type=UsesDependency
|
dependency20.type=UsesDependency
|
||||||
dependency21.from=Player
|
dependency21.from=Player
|
||||||
dependency21.to=Projectile
|
dependency21.to=Enemy
|
||||||
dependency21.type=UsesDependency
|
dependency21.type=UsesDependency
|
||||||
dependency22.from=Player
|
dependency22.from=Healthbar
|
||||||
dependency22.to=Enemy
|
dependency22.to=Player
|
||||||
dependency22.type=UsesDependency
|
dependency22.type=UsesDependency
|
||||||
dependency23.from=UnactiveSpike
|
dependency23.from=UnactiveSpike
|
||||||
dependency23.to=SpikedPlattform
|
dependency23.to=SpikedPlattform
|
||||||
@@ -69,63 +70,60 @@ dependency24.type=UsesDependency
|
|||||||
dependency25.from=UnactiveSpike
|
dependency25.from=UnactiveSpike
|
||||||
dependency25.to=Spike
|
dependency25.to=Spike
|
||||||
dependency25.type=UsesDependency
|
dependency25.type=UsesDependency
|
||||||
dependency26.from=Healthbar
|
dependency26.from=Plattform
|
||||||
dependency26.to=Player
|
dependency26.to=MyWorld
|
||||||
dependency26.type=UsesDependency
|
dependency26.type=UsesDependency
|
||||||
dependency27.from=Plattform
|
dependency27.from=Plattform
|
||||||
dependency27.to=MyWorld
|
dependency27.to=Player
|
||||||
dependency27.type=UsesDependency
|
dependency27.type=UsesDependency
|
||||||
dependency28.from=Plattform
|
dependency28.from=MovingPlattform
|
||||||
dependency28.to=Player
|
dependency28.to=MyWorld
|
||||||
dependency28.type=UsesDependency
|
dependency28.type=UsesDependency
|
||||||
dependency29.from=MovingPlattform
|
dependency29.from=MovingPlattform
|
||||||
dependency29.to=MyWorld
|
dependency29.to=Player
|
||||||
dependency29.type=UsesDependency
|
dependency29.type=UsesDependency
|
||||||
dependency3.from=PlayerTestWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=Player
|
dependency3.to=Player
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
dependency30.from=MovingPlattform
|
dependency30.from=SpikedPlattform
|
||||||
dependency30.to=Player
|
dependency30.to=Spike
|
||||||
dependency30.type=UsesDependency
|
dependency30.type=UsesDependency
|
||||||
dependency31.from=SpikedPlattform
|
dependency31.from=SpikedPlattform
|
||||||
dependency31.to=Spike
|
dependency31.to=GameOverWorld
|
||||||
dependency31.type=UsesDependency
|
dependency31.type=UsesDependency
|
||||||
dependency32.from=SpikedPlattform
|
dependency32.from=SpikedPlattform
|
||||||
dependency32.to=GameOverWorld
|
dependency32.to=MyWorld
|
||||||
dependency32.type=UsesDependency
|
dependency32.type=UsesDependency
|
||||||
dependency33.from=SpikedPlattform
|
dependency33.from=SpikedPlattform
|
||||||
dependency33.to=MyWorld
|
dependency33.to=UnactiveSpike
|
||||||
dependency33.type=UsesDependency
|
dependency33.type=UsesDependency
|
||||||
dependency34.from=SpikedPlattform
|
dependency34.from=TargetingProjectile
|
||||||
dependency34.to=UnactiveSpike
|
dependency34.to=Player
|
||||||
dependency34.type=UsesDependency
|
dependency34.type=UsesDependency
|
||||||
dependency35.from=TargetingProjectile
|
dependency35.from=Button
|
||||||
dependency35.to=Player
|
dependency35.to=MyWorld
|
||||||
dependency35.type=UsesDependency
|
dependency35.type=UsesDependency
|
||||||
dependency36.from=Button
|
dependency36.from=PowerUps
|
||||||
dependency36.to=MyWorld
|
dependency36.to=Player
|
||||||
dependency36.type=UsesDependency
|
dependency36.type=UsesDependency
|
||||||
dependency37.from=PowerUps
|
dependency37.from=HealthItem
|
||||||
dependency37.to=Player
|
dependency37.to=Player
|
||||||
dependency37.type=UsesDependency
|
dependency37.type=UsesDependency
|
||||||
dependency38.from=HealthItem
|
dependency38.from=JumpBoostItem
|
||||||
dependency38.to=Player
|
dependency38.to=Player
|
||||||
dependency38.type=UsesDependency
|
dependency38.type=UsesDependency
|
||||||
dependency39.from=JumpBoostItem
|
dependency39.from=Enemy
|
||||||
dependency39.to=Player
|
dependency39.to=Player
|
||||||
dependency39.type=UsesDependency
|
dependency39.type=UsesDependency
|
||||||
dependency4.from=PlayerTestWorld
|
dependency4.from=PlayerTestWorld
|
||||||
dependency4.to=JumpBoostItem
|
dependency4.to=JumpBoostItem
|
||||||
dependency4.type=UsesDependency
|
dependency4.type=UsesDependency
|
||||||
dependency40.from=Enemy
|
dependency40.from=Enemy
|
||||||
dependency40.to=Player
|
dependency40.to=EnemyProjectile
|
||||||
dependency40.type=UsesDependency
|
dependency40.type=UsesDependency
|
||||||
dependency41.from=Enemy
|
dependency41.from=PlayerProjectile
|
||||||
dependency41.to=EnemyProjectile
|
dependency41.to=Enemy
|
||||||
dependency41.type=UsesDependency
|
dependency41.type=UsesDependency
|
||||||
dependency42.from=PlayerProjectile
|
|
||||||
dependency42.to=Enemy
|
|
||||||
dependency42.type=UsesDependency
|
|
||||||
dependency5.from=StartWorld
|
dependency5.from=StartWorld
|
||||||
dependency5.to=Button
|
dependency5.to=Button
|
||||||
dependency5.type=UsesDependency
|
dependency5.type=UsesDependency
|
||||||
@@ -139,14 +137,14 @@ dependency8.from=MyWorld
|
|||||||
dependency8.to=Plattform
|
dependency8.to=Plattform
|
||||||
dependency8.type=UsesDependency
|
dependency8.type=UsesDependency
|
||||||
dependency9.from=MyWorld
|
dependency9.from=MyWorld
|
||||||
dependency9.to=Healthbar
|
dependency9.to=MovingPlattform
|
||||||
dependency9.type=UsesDependency
|
dependency9.type=UsesDependency
|
||||||
editor.fx.0.height=737
|
editor.fx.0.height=737
|
||||||
editor.fx.0.width=814
|
editor.fx.0.width=814
|
||||||
editor.fx.0.x=360
|
editor.fx.0.x=330
|
||||||
editor.fx.0.y=26
|
editor.fx.0.y=72
|
||||||
height=822
|
height=830
|
||||||
package.numDependencies=42
|
package.numDependencies=41
|
||||||
package.numTargets=23
|
package.numTargets=23
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
@@ -289,7 +287,7 @@ 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=Healthbar
|
||||||
target5.showInterface=false
|
target5.showInterface=false
|
||||||
target5.type=ClassTarget
|
target5.type=ClassTarget
|
||||||
target5.width=120
|
target5.width=120
|
||||||
@@ -303,7 +301,7 @@ 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=UnactiveSpike
|
||||||
target7.showInterface=false
|
target7.showInterface=false
|
||||||
target7.type=ClassTarget
|
target7.type=ClassTarget
|
||||||
target7.width=120
|
target7.width=120
|
||||||
@@ -324,7 +322,7 @@ 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=1550
|
||||||
world.lastInstantiated=MyWorld
|
world.lastInstantiated=MyWorld
|
||||||
xPosition=532
|
xPosition=0
|
||||||
yPosition=117
|
yPosition=0
|
||||||
|
|||||||
Reference in New Issue
Block a user