Der Spieler kann nun über die Bildschirmränder auf die andere Seite des Fensters
This commit is contained in:
Binary file not shown.
@@ -8,7 +8,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
|||||||
*/
|
*/
|
||||||
public class JumpBoostItem extends PowerUps
|
public class JumpBoostItem extends PowerUps
|
||||||
{
|
{
|
||||||
int duration = 60*5;
|
int duration = 60*30;
|
||||||
public void act()
|
public void act()
|
||||||
{
|
{
|
||||||
touchedByPlayer();
|
touchedByPlayer();
|
||||||
|
|||||||
Binary file not shown.
@@ -50,6 +50,14 @@ public class MyWorld extends World
|
|||||||
plattform2.setLocation(320,367);
|
plattform2.setLocation(320,367);
|
||||||
plattform2.setLocation(312,371);
|
plattform2.setLocation(312,371);
|
||||||
plattform2.setLocation(308,382);
|
plattform2.setLocation(308,382);
|
||||||
|
JumpBoostItem jumpBoostItem = new JumpBoostItem();
|
||||||
|
addObject(jumpBoostItem,312,427);
|
||||||
|
jumpBoostItem.setLocation(308,304);
|
||||||
|
player.setLocation(308,354);
|
||||||
|
player.setLocation(308,320);
|
||||||
|
player.setLocation(248,337);
|
||||||
|
player.setLocation(288,346);
|
||||||
|
player.setLocation(292,337);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void act()
|
public void act()
|
||||||
|
|||||||
Binary file not shown.
@@ -28,10 +28,16 @@ public class Player extends Actor
|
|||||||
fall();
|
fall();
|
||||||
handlePowerUps();
|
handlePowerUps();
|
||||||
|
|
||||||
//Check ob der Spieler am unteren Bildschirmrand ist
|
//Check ob der Spieler am unteren Fensterrand ist
|
||||||
if (getY()+1 >= getWorld().getHeight()){
|
if (getY()+1 >= getWorld().getHeight()){
|
||||||
Greenfoot.setWorld(new GameOverWorld());
|
Greenfoot.setWorld(new GameOverWorld());
|
||||||
}
|
}
|
||||||
|
//Check ob der Spieler an der Seite vom Fenster ist
|
||||||
|
if (getX() <= 0){
|
||||||
|
setLocation(getWorld().getWidth(), getY());
|
||||||
|
} else if (getX() >= getWorld().getWidth()-1){
|
||||||
|
setLocation(1, getY());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bewegung nach links und rechts
|
// Bewegung nach links und rechts
|
||||||
|
|||||||
@@ -1,48 +1,79 @@
|
|||||||
#Greenfoot project file
|
#Greenfoot project file
|
||||||
|
class.BreakingPlattform.image=Unbenannt2.png
|
||||||
class.Button.image=button-red.png
|
class.Button.image=button-red.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.MovingPlattform.image=Unbenannt.png
|
||||||
class.MyWorld.image=GameBackground.png
|
class.MyWorld.image=GameBackground.png
|
||||||
|
class.Plattform.image=Plattform.png
|
||||||
class.Player.image=ppl2.png
|
class.Player.image=ppl2.png
|
||||||
class.Projectile.image=Projectile1.png
|
class.Projectile.image=Projectile1.png
|
||||||
|
class.Spike.image=Spike.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
|
||||||
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=Projectile
|
dependency10.to=BreakingPlattform
|
||||||
dependency10.type=UsesDependency
|
dependency10.type=UsesDependency
|
||||||
dependency11.from=Player
|
dependency11.from=MyWorld
|
||||||
dependency11.to=GameOverWorld
|
dependency11.to=Projectile
|
||||||
dependency11.type=UsesDependency
|
dependency11.type=UsesDependency
|
||||||
dependency12.from=Player
|
dependency12.from=MyWorld
|
||||||
dependency12.to=Ground
|
dependency12.to=TargetingProjectile
|
||||||
dependency12.type=UsesDependency
|
dependency12.type=UsesDependency
|
||||||
dependency13.from=Player
|
dependency13.from=Spike
|
||||||
dependency13.to=Projectile
|
dependency13.to=GameOverWorld
|
||||||
dependency13.type=UsesDependency
|
dependency13.type=UsesDependency
|
||||||
dependency14.from=Plattform
|
dependency14.from=Spike
|
||||||
dependency14.to=MyWorld
|
dependency14.to=Player
|
||||||
dependency14.type=UsesDependency
|
dependency14.type=UsesDependency
|
||||||
dependency15.from=Plattform
|
dependency15.from=Player
|
||||||
dependency15.to=Player
|
dependency15.to=GameOverWorld
|
||||||
dependency15.type=UsesDependency
|
dependency15.type=UsesDependency
|
||||||
dependency16.from=MovingPlattform
|
dependency16.from=Player
|
||||||
dependency16.to=MyWorld
|
dependency16.to=Plattform
|
||||||
dependency16.type=UsesDependency
|
dependency16.type=UsesDependency
|
||||||
dependency17.from=Button
|
dependency17.from=Player
|
||||||
dependency17.to=MyWorld
|
dependency17.to=Projectile
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=PowerUps
|
dependency18.from=Plattform
|
||||||
dependency18.to=Player
|
dependency18.to=MyWorld
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=JumpBoostItem
|
dependency19.from=Plattform
|
||||||
dependency19.to=Player
|
dependency19.to=Player
|
||||||
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.to=MyWorld
|
||||||
|
dependency20.type=UsesDependency
|
||||||
|
dependency21.from=SpikedPlattform
|
||||||
|
dependency21.to=Spike
|
||||||
|
dependency21.type=UsesDependency
|
||||||
|
dependency22.from=SpikedPlattform
|
||||||
|
dependency22.to=GameOverWorld
|
||||||
|
dependency22.type=UsesDependency
|
||||||
|
dependency23.from=SpikedPlattform
|
||||||
|
dependency23.to=MyWorld
|
||||||
|
dependency23.type=UsesDependency
|
||||||
|
dependency24.from=TargetingProjectile
|
||||||
|
dependency24.to=Player
|
||||||
|
dependency24.type=UsesDependency
|
||||||
|
dependency25.from=Button
|
||||||
|
dependency25.to=MyWorld
|
||||||
|
dependency25.type=UsesDependency
|
||||||
|
dependency26.from=PowerUps
|
||||||
|
dependency26.to=Player
|
||||||
|
dependency26.type=UsesDependency
|
||||||
|
dependency27.from=JumpBoostItem
|
||||||
|
dependency27.to=Player
|
||||||
|
dependency27.type=UsesDependency
|
||||||
dependency3.from=PlayerTestWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=Player
|
dependency3.to=Player
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
@@ -56,21 +87,21 @@ dependency6.from=MyWorld
|
|||||||
dependency6.to=Player
|
dependency6.to=Player
|
||||||
dependency6.type=UsesDependency
|
dependency6.type=UsesDependency
|
||||||
dependency7.from=MyWorld
|
dependency7.from=MyWorld
|
||||||
dependency7.to=Plattform
|
dependency7.to=Score
|
||||||
dependency7.type=UsesDependency
|
dependency7.type=UsesDependency
|
||||||
dependency8.from=MyWorld
|
dependency8.from=MyWorld
|
||||||
dependency8.to=MovingPlattform
|
dependency8.to=Plattform
|
||||||
dependency8.type=UsesDependency
|
dependency8.type=UsesDependency
|
||||||
dependency9.from=MyWorld
|
dependency9.from=MyWorld
|
||||||
dependency9.to=BreakingPlattform
|
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=360
|
||||||
editor.fx.0.y=26
|
editor.fx.0.y=26
|
||||||
height=830
|
height=830
|
||||||
package.numDependencies=19
|
package.numDependencies=27
|
||||||
package.numTargets=14
|
package.numTargets=18
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
publish.locked=true
|
publish.locked=true
|
||||||
@@ -86,98 +117,126 @@ readme.x=10
|
|||||||
readme.y=10
|
readme.y=10
|
||||||
simulation.speed=50
|
simulation.speed=50
|
||||||
target1.height=70
|
target1.height=70
|
||||||
target1.name=Player
|
target1.name=Spike
|
||||||
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=TargetingProjectile
|
target10.name=StartWorld
|
||||||
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=Projectile
|
target11.name=Plattform
|
||||||
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=Button
|
target12.name=TargetingProjectile
|
||||||
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=PowerUps
|
target13.name=Projectile
|
||||||
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=MyWorld
|
target14.name=Score
|
||||||
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.name=Button
|
||||||
|
target15.showInterface=false
|
||||||
|
target15.type=ClassTarget
|
||||||
|
target15.width=120
|
||||||
|
target15.x=0
|
||||||
|
target15.y=0
|
||||||
|
target16.height=70
|
||||||
|
target16.name=PowerUps
|
||||||
|
target16.showInterface=false
|
||||||
|
target16.type=ClassTarget
|
||||||
|
target16.width=120
|
||||||
|
target16.x=0
|
||||||
|
target16.y=0
|
||||||
|
target17.height=70
|
||||||
|
target17.name=SpikedPlattform
|
||||||
|
target17.showInterface=false
|
||||||
|
target17.type=ClassTarget
|
||||||
|
target17.width=120
|
||||||
|
target17.x=0
|
||||||
|
target17.y=0
|
||||||
|
target18.height=70
|
||||||
|
target18.name=MyWorld
|
||||||
|
target18.showInterface=false
|
||||||
|
target18.type=ClassTarget
|
||||||
|
target18.width=120
|
||||||
|
target18.x=0
|
||||||
|
target18.y=0
|
||||||
target2.height=70
|
target2.height=70
|
||||||
target2.name=MovingPlattform
|
target2.name=Player
|
||||||
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
|
||||||
target3.height=70
|
target3.height=70
|
||||||
target3.name=Ground
|
target3.name=MovingPlattform
|
||||||
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=JumpBoostItem
|
target4.name=Ground
|
||||||
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=BreakingPlattform
|
target5.name=UnactiveSpike
|
||||||
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=GameOverWorld
|
target6.name=JumpBoostItem
|
||||||
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=PlayerTestWorld
|
target7.name=BreakingPlattform
|
||||||
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=StartWorld
|
target8.name=GameOverWorld
|
||||||
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=Plattform
|
target9.name=PlayerTestWorld
|
||||||
target9.showInterface=false
|
target9.showInterface=false
|
||||||
target9.type=ClassTarget
|
target9.type=ClassTarget
|
||||||
target9.width=120
|
target9.width=120
|
||||||
|
|||||||
Reference in New Issue
Block a user