Projectile fix
This commit is contained in:
Binary file not shown.
+17
-6
@@ -11,7 +11,7 @@ public class MyWorld extends World
|
|||||||
int PlattformCountdown;
|
int PlattformCountdown;
|
||||||
int timer = 200; //Zeit, bevor das erste Projektil auftaucht
|
int timer = 200; //Zeit, bevor das erste Projektil auftaucht
|
||||||
//kann später noch beliebig angepasst werden
|
//kann später noch beliebig angepasst werden
|
||||||
|
int targetTimer = 1000;
|
||||||
/**
|
/**
|
||||||
* Constructor for objects of class MyWorld.
|
* Constructor for objects of class MyWorld.
|
||||||
*
|
*
|
||||||
@@ -51,15 +51,26 @@ public class MyWorld extends World
|
|||||||
{
|
{
|
||||||
addObject(new MovingPlattform(-2), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
|
addObject(new MovingPlattform(-2), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
Projectile projectile = new Projectile();
|
|
||||||
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
|
|
||||||
timer = 200; //zeitlicher Abstand
|
|
||||||
if(Greenfoot.getRandomNumber(100000)>=99750)
|
if(Greenfoot.getRandomNumber(100000)>=99750)
|
||||||
{
|
{
|
||||||
addObject(new BreakingPlattform(50), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
|
addObject(new BreakingPlattform(50), Greenfoot.getRandomNumber(400), 6); //Nach Links bewegende Plattform
|
||||||
}
|
}
|
||||||
//zwischen den x Werten 50 und 350 spawnen die Projektile (anpassbar)
|
if(timer == 0){
|
||||||
|
Projectile projectile = new Projectile();
|
||||||
|
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
|
||||||
|
timer = 200; //zeitlicher Abstand
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
timer = timer - 1;
|
||||||
|
}
|
||||||
|
//if(timer == 0){
|
||||||
|
// TargetingProjectile targetingProjectile = new TargetingProjectile();
|
||||||
|
// addObject(targetingProjectile, Greenfoot.getRandomNumber(300)+50,0);
|
||||||
|
// timer = 1000;
|
||||||
|
//}
|
||||||
|
//else{
|
||||||
|
// timer = timer - 1;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,3 @@ comment6.target=void\ handlePowerUps()
|
|||||||
comment7.params=duration\ type
|
comment7.params=duration\ type
|
||||||
comment7.target=void\ reveivePowerUp(int,\ java.lang.String)
|
comment7.target=void\ reveivePowerUp(int,\ java.lang.String)
|
||||||
numComments=8
|
numComments=8
|
||||||
comment3.target=void\ jump()
|
|
||||||
comment4.params=
|
|
||||||
comment4.target=void\ fall()
|
|
||||||
comment5.params=
|
|
||||||
comment5.target=boolean\ collision()
|
|
||||||
numComments=6
|
|
||||||
|
|||||||
+104
-50
@@ -6,54 +6,71 @@ class.MyWorld.image=GameBackground.png
|
|||||||
class.Player.image=ppl2.png
|
class.Player.image=ppl2.png
|
||||||
class.Projectile.image=Projectile1.png
|
class.Projectile.image=Projectile1.png
|
||||||
class.StartWorld.image=StartBackground.png
|
class.StartWorld.image=StartBackground.png
|
||||||
|
class.TargetingProjectile.image=blue-draught.png
|
||||||
dependency1.from=GameOverWorld
|
dependency1.from=GameOverWorld
|
||||||
dependency1.to=Button
|
dependency1.to=Button
|
||||||
dependency1.from=PlayerTestWorld
|
|
||||||
dependency1.to=Ground
|
|
||||||
dependency1.type=UsesDependency
|
dependency1.type=UsesDependency
|
||||||
dependency2.from=StartWorld
|
dependency10.from=MyWorld
|
||||||
dependency2.to=Button
|
dependency10.to=Projectile
|
||||||
|
dependency10.type=UsesDependency
|
||||||
|
dependency11.from=Player
|
||||||
|
dependency11.to=GameOverWorld
|
||||||
|
dependency11.type=UsesDependency
|
||||||
|
dependency12.from=Player
|
||||||
|
dependency12.to=Ground
|
||||||
|
dependency12.type=UsesDependency
|
||||||
|
dependency13.from=Player
|
||||||
|
dependency13.to=Projectile
|
||||||
|
dependency13.type=UsesDependency
|
||||||
|
dependency14.from=Plattform
|
||||||
|
dependency14.to=MyWorld
|
||||||
|
dependency14.type=UsesDependency
|
||||||
|
dependency15.from=Plattform
|
||||||
|
dependency15.to=Player
|
||||||
|
dependency15.type=UsesDependency
|
||||||
|
dependency16.from=MovingPlattform
|
||||||
|
dependency16.to=MyWorld
|
||||||
|
dependency16.type=UsesDependency
|
||||||
|
dependency17.from=Button
|
||||||
|
dependency17.to=MyWorld
|
||||||
|
dependency17.type=UsesDependency
|
||||||
|
dependency18.from=PowerUps
|
||||||
|
dependency18.to=Player
|
||||||
|
dependency18.type=UsesDependency
|
||||||
|
dependency19.from=JumpBoostItem
|
||||||
|
dependency19.to=Player
|
||||||
|
dependency19.type=UsesDependency
|
||||||
dependency2.from=PlayerTestWorld
|
dependency2.from=PlayerTestWorld
|
||||||
dependency2.to=Player
|
dependency2.to=Ground
|
||||||
dependency2.type=UsesDependency
|
dependency2.type=UsesDependency
|
||||||
dependency3.from=MyWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=Player
|
dependency3.to=Player
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
dependency4.from=MyWorld
|
dependency4.from=PlayerTestWorld
|
||||||
dependency4.to=Projectile
|
dependency4.to=JumpBoostItem
|
||||||
dependency4.type=UsesDependency
|
dependency4.type=UsesDependency
|
||||||
dependency5.from=Player
|
dependency5.from=StartWorld
|
||||||
dependency5.to=GameOverWorld
|
dependency5.to=Button
|
||||||
dependency5.type=UsesDependency
|
dependency5.type=UsesDependency
|
||||||
dependency6.from=Player
|
dependency6.from=MyWorld
|
||||||
dependency6.to=Ground
|
dependency6.to=Player
|
||||||
dependency6.type=UsesDependency
|
dependency6.type=UsesDependency
|
||||||
dependency7.from=Player
|
dependency7.from=MyWorld
|
||||||
dependency7.to=Projectile
|
dependency7.to=Plattform
|
||||||
dependency7.type=UsesDependency
|
dependency7.type=UsesDependency
|
||||||
dependency8.from=Button
|
dependency8.from=MyWorld
|
||||||
dependency8.to=MyWorld
|
dependency8.to=MovingPlattform
|
||||||
dependency8.type=UsesDependency
|
dependency8.type=UsesDependency
|
||||||
editor.fx.0.height=737
|
dependency9.from=MyWorld
|
||||||
editor.fx.0.width=814
|
dependency9.to=BreakingPlattform
|
||||||
editor.fx.0.x=-19
|
dependency9.type=UsesDependency
|
||||||
editor.fx.0.y=65
|
|
||||||
height=736
|
|
||||||
package.numDependencies=8
|
|
||||||
package.numTargets=7
|
|
||||||
dependency3.from=MyWorld
|
|
||||||
dependency3.to=Player
|
|
||||||
dependency3.type=UsesDependency
|
|
||||||
dependency4.from=Player
|
|
||||||
dependency4.to=Ground
|
|
||||||
dependency4.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=4
|
package.numDependencies=19
|
||||||
package.numTargets=4
|
package.numTargets=14
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
publish.locked=true
|
publish.locked=true
|
||||||
@@ -75,62 +92,99 @@ 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.name=TargetingProjectile
|
||||||
|
target10.showInterface=false
|
||||||
|
target10.type=ClassTarget
|
||||||
|
target10.width=120
|
||||||
|
target10.x=0
|
||||||
|
target10.y=0
|
||||||
|
target11.height=70
|
||||||
|
target11.name=Projectile
|
||||||
|
target11.showInterface=false
|
||||||
|
target11.type=ClassTarget
|
||||||
|
target11.width=120
|
||||||
|
target11.x=0
|
||||||
|
target11.y=0
|
||||||
|
target12.height=70
|
||||||
|
target12.name=Button
|
||||||
|
target12.showInterface=false
|
||||||
|
target12.type=ClassTarget
|
||||||
|
target12.width=120
|
||||||
|
target12.x=0
|
||||||
|
target12.y=0
|
||||||
|
target13.height=70
|
||||||
|
target13.name=PowerUps
|
||||||
|
target13.showInterface=false
|
||||||
|
target13.type=ClassTarget
|
||||||
|
target13.width=120
|
||||||
|
target13.x=0
|
||||||
|
target13.y=0
|
||||||
|
target14.height=70
|
||||||
|
target14.name=MyWorld
|
||||||
|
target14.showInterface=false
|
||||||
|
target14.type=ClassTarget
|
||||||
|
target14.width=120
|
||||||
|
target14.x=0
|
||||||
|
target14.y=0
|
||||||
target2.height=70
|
target2.height=70
|
||||||
target2.name=Ground
|
target2.name=MovingPlattform
|
||||||
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=Button
|
target3.name=Ground
|
||||||
target3.name=PlayerTestWorld
|
|
||||||
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=GameOverWorld
|
target4.name=JumpBoostItem
|
||||||
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=StartWorld
|
target5.name=BreakingPlattform
|
||||||
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=MyWorld
|
target6.name=GameOverWorld
|
||||||
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=Projectile
|
target7.name=PlayerTestWorld
|
||||||
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
|
||||||
target4.height=70
|
target8.height=70
|
||||||
target4.name=MyWorld
|
target8.name=StartWorld
|
||||||
target4.showInterface=false
|
target8.showInterface=false
|
||||||
target4.type=ClassTarget
|
target8.type=ClassTarget
|
||||||
target4.width=120
|
target8.width=120
|
||||||
target4.x=0
|
target8.x=0
|
||||||
target4.y=0
|
target8.y=0
|
||||||
|
target9.height=70
|
||||||
|
target9.name=Plattform
|
||||||
|
target9.showInterface=false
|
||||||
|
target9.type=ClassTarget
|
||||||
|
target9.width=120
|
||||||
|
target9.x=0
|
||||||
|
target9.y=0
|
||||||
version=3.1.0
|
version=3.1.0
|
||||||
width=856
|
|
||||||
world.lastInstantiated=StartWorld
|
|
||||||
xPosition=652
|
|
||||||
yPosition=76
|
|
||||||
width=1550
|
width=1550
|
||||||
world.lastInstantiated=PlayerTestWorld
|
world.lastInstantiated=MyWorld
|
||||||
xPosition=0
|
xPosition=0
|
||||||
yPosition=0
|
yPosition=0
|
||||||
|
|||||||
Reference in New Issue
Block a user