Merge remote-tracking branch 'origin/main'
# Conflicts: # SMIMS-Game/MyWorld.class # SMIMS-Game/Player.class # SMIMS-Game/Player.java # SMIMS-Game/project.greenfoot
This commit is contained in:
Binary file not shown.
@@ -57,8 +57,8 @@ 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);
|
||||||
Healthbar healthbar = new Healthbar();
|
//Healthbar healthbar = new Healthbar();
|
||||||
addObject(healthbar,50,50);
|
//addObject(healthbar,50,50);
|
||||||
Heart heart = new Heart();
|
Heart heart = new Heart();
|
||||||
addObject(heart,371,27);
|
addObject(heart,371,27);
|
||||||
Heart heart2 = new Heart();
|
Heart heart2 = new Heart();
|
||||||
|
|||||||
Binary file not shown.
@@ -121,6 +121,13 @@ public class Player extends Actor
|
|||||||
getWorld().removeObjects(getWorld().getObjects(Spike.class));
|
getWorld().removeObjects(getWorld().getObjects(Spike.class));
|
||||||
|
|
||||||
getWorld().removeObjects(getIntersectingObjects(Spike.class));
|
getWorld().removeObjects(getIntersectingObjects(Spike.class));
|
||||||
|
if (getWorld().getObjects(Heart.class) != null){
|
||||||
|
if (health == 2){
|
||||||
|
getWorld().getObjects(Heart.class).get(2).setImage("a.png");
|
||||||
|
} else if (health == 1){
|
||||||
|
getWorld().getObjects(Heart.class).get(1).setImage("a.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,6 +156,11 @@ public class Player extends Actor
|
|||||||
break;
|
break;
|
||||||
case "Heal":
|
case "Heal":
|
||||||
if (health < MAX_HEALTH){
|
if (health < MAX_HEALTH){
|
||||||
|
if (health == 2){
|
||||||
|
getWorld().getObjects(Heart.class).get(2).setImage("Health.png");
|
||||||
|
} else if (health == 1){
|
||||||
|
getWorld().getObjects(Heart.class).get(1).setImage("Health.png");
|
||||||
|
}
|
||||||
health++;
|
health++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Binary file not shown.
@@ -34,8 +34,8 @@ public class PowerUps extends Actor
|
|||||||
|
|
||||||
public void moveDown()
|
public void moveDown()
|
||||||
{
|
{
|
||||||
this.setLocation(this.getX(), this.getY()+2);
|
setLocation(this.getX(), this.getY()+2);
|
||||||
if(this.getY()>=this.getWorld().getHeight())
|
if(this.getY() >= getWorld().getHeight()-1)
|
||||||
{
|
{
|
||||||
deleteAfterActCycle = true;
|
deleteAfterActCycle = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
#Greenfoot project file
|
#Greenfoot project file
|
||||||
class.BreakingPlattform.image=Breaking1.png
|
class.BreakingPlattform.image=Breaking1.png
|
||||||
|
class.Button.image=button-red.png
|
||||||
|
class.Enemy.image=bee.png
|
||||||
|
class.GameOverWorld.image=GameOverBackground.png
|
||||||
class.Ground.image=weave.jpg
|
class.Ground.image=weave.jpg
|
||||||
class.Groundflower.image=flower2.png
|
class.Groundflower.image=flower2.png
|
||||||
class.HealthItem.image=Health.png
|
class.HealthItem.image=Health.png
|
||||||
|
class.Heart.image=Health.png
|
||||||
class.JumpBoostItem.image=mushroom.png
|
class.JumpBoostItem.image=mushroom.png
|
||||||
class.MovingPlattform.image=Unbenannt.png
|
class.MovingPlattform.image=Platform1.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.Spike.image=Spike.png
|
class.PlayerProjectile.image=beeper.png
|
||||||
class.SpikedPlattform.image=Spikes.png
|
class.Projectile.image=Projectile1.png
|
||||||
class.TemporaryGround.image=TemporaryGround.png
|
class.Spike.image=singleSpike.png
|
||||||
class.UnactiveSpike.image=Spike_Copy.png
|
class.SpikedPlattform.image=Spikes2.png
|
||||||
|
class.StartWorld.image=StartBackground.png
|
||||||
|
class.TargetingProjectile.image=blue-draught.png
|
||||||
|
class.UnactiveSpike.image=inactiveSpike.png
|
||||||
dependency1.from=PlayerTestWorld
|
dependency1.from=PlayerTestWorld
|
||||||
dependency1.to=Ground
|
dependency1.to=Ground
|
||||||
dependency1.type=UsesDependency
|
dependency1.type=UsesDependency
|
||||||
@@ -27,128 +35,125 @@ dependency13.from=MyWorld
|
|||||||
dependency13.to=Groundflower
|
dependency13.to=Groundflower
|
||||||
dependency13.type=UsesDependency
|
dependency13.type=UsesDependency
|
||||||
dependency14.from=MyWorld
|
dependency14.from=MyWorld
|
||||||
dependency14.to=HealthItem
|
dependency14.to=Enemy
|
||||||
dependency14.type=UsesDependency
|
dependency14.type=UsesDependency
|
||||||
dependency15.from=MyWorld
|
dependency15.from=MyWorld
|
||||||
dependency15.to=JumpBoostItem
|
dependency15.to=Projectile
|
||||||
dependency15.type=UsesDependency
|
dependency15.type=UsesDependency
|
||||||
dependency16.from=MyWorld
|
dependency16.from=MyWorld
|
||||||
dependency16.to=Enemy
|
dependency16.to=TargetingProjectile
|
||||||
dependency16.type=UsesDependency
|
dependency16.type=UsesDependency
|
||||||
dependency17.from=MyWorld
|
dependency17.from=GameOverWorld
|
||||||
dependency17.to=Projectile
|
dependency17.to=Button
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=MyWorld
|
dependency18.from=StartWorld
|
||||||
dependency18.to=TargetingProjectile
|
dependency18.to=Button
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=GameOverWorld
|
dependency19.from=UnactiveSpike
|
||||||
dependency19.to=Button
|
dependency19.to=SpikedPlattform
|
||||||
dependency19.type=UsesDependency
|
dependency19.type=UsesDependency
|
||||||
dependency2.from=PlayerTestWorld
|
dependency2.from=PlayerTestWorld
|
||||||
dependency2.to=Player
|
dependency2.to=Player
|
||||||
dependency2.type=UsesDependency
|
dependency2.type=UsesDependency
|
||||||
dependency20.from=StartWorld
|
dependency20.from=UnactiveSpike
|
||||||
dependency20.to=Button
|
dependency20.to=MyWorld
|
||||||
dependency20.type=UsesDependency
|
dependency20.type=UsesDependency
|
||||||
dependency21.from=UnactiveSpike
|
dependency21.from=UnactiveSpike
|
||||||
dependency21.to=SpikedPlattform
|
dependency21.to=Spike
|
||||||
dependency21.type=UsesDependency
|
dependency21.type=UsesDependency
|
||||||
dependency22.from=UnactiveSpike
|
dependency22.from=Button
|
||||||
dependency22.to=MyWorld
|
dependency22.to=MyWorld
|
||||||
dependency22.type=UsesDependency
|
dependency22.type=UsesDependency
|
||||||
dependency23.from=UnactiveSpike
|
dependency23.from=PowerUps
|
||||||
dependency23.to=Spike
|
dependency23.to=Player
|
||||||
dependency23.type=UsesDependency
|
dependency23.type=UsesDependency
|
||||||
dependency24.from=Button
|
dependency24.from=HealthItem
|
||||||
dependency24.to=MyWorld
|
dependency24.to=Player
|
||||||
dependency24.type=UsesDependency
|
dependency24.type=UsesDependency
|
||||||
dependency25.from=PowerUps
|
dependency25.from=JumpBoostItem
|
||||||
dependency25.to=Player
|
dependency25.to=Player
|
||||||
dependency25.type=UsesDependency
|
dependency25.type=UsesDependency
|
||||||
dependency26.from=HealthItem
|
dependency26.from=Groundflower
|
||||||
dependency26.to=Player
|
dependency26.to=Player
|
||||||
dependency26.type=UsesDependency
|
dependency26.type=UsesDependency
|
||||||
dependency27.from=JumpBoostItem
|
dependency27.from=Enemy
|
||||||
dependency27.to=Player
|
dependency27.to=Player
|
||||||
dependency27.type=UsesDependency
|
dependency27.type=UsesDependency
|
||||||
dependency28.from=Groundflower
|
dependency28.from=Enemy
|
||||||
dependency28.to=Player
|
dependency28.to=EnemyProjectile
|
||||||
dependency28.type=UsesDependency
|
dependency28.type=UsesDependency
|
||||||
dependency29.from=Enemy
|
dependency29.from=Spike
|
||||||
dependency29.to=Player
|
dependency29.to=MyWorld
|
||||||
dependency29.type=UsesDependency
|
dependency29.type=UsesDependency
|
||||||
dependency3.from=PlayerTestWorld
|
dependency3.from=PlayerTestWorld
|
||||||
dependency3.to=JumpBoostItem
|
dependency3.to=JumpBoostItem
|
||||||
dependency3.type=UsesDependency
|
dependency3.type=UsesDependency
|
||||||
dependency30.from=Enemy
|
dependency30.from=Player
|
||||||
dependency30.to=EnemyProjectile
|
dependency30.to=GameOverWorld
|
||||||
dependency30.type=UsesDependency
|
dependency30.type=UsesDependency
|
||||||
dependency31.from=Spike
|
dependency31.from=Player
|
||||||
dependency31.to=MyWorld
|
dependency31.to=Plattform
|
||||||
dependency31.type=UsesDependency
|
dependency31.type=UsesDependency
|
||||||
dependency32.from=Player
|
dependency32.from=Player
|
||||||
dependency32.to=GameOverWorld
|
dependency32.to=PlayerProjectile
|
||||||
dependency32.type=UsesDependency
|
dependency32.type=UsesDependency
|
||||||
dependency33.from=Player
|
dependency33.from=Player
|
||||||
dependency33.to=Plattform
|
dependency33.to=TemporaryGround
|
||||||
dependency33.type=UsesDependency
|
dependency33.type=UsesDependency
|
||||||
dependency34.from=Player
|
dependency34.from=Player
|
||||||
dependency34.to=PlayerProjectile
|
dependency34.to=Projectile
|
||||||
dependency34.type=UsesDependency
|
dependency34.type=UsesDependency
|
||||||
dependency35.from=Player
|
dependency35.from=Player
|
||||||
dependency35.to=TemporaryGround
|
dependency35.to=Enemy
|
||||||
dependency35.type=UsesDependency
|
dependency35.type=UsesDependency
|
||||||
dependency36.from=Player
|
dependency36.from=Player
|
||||||
dependency36.to=Projectile
|
dependency36.to=Spike
|
||||||
dependency36.type=UsesDependency
|
dependency36.type=UsesDependency
|
||||||
dependency37.from=Player
|
dependency37.from=Player
|
||||||
dependency37.to=Enemy
|
dependency37.to=Heart
|
||||||
dependency37.type=UsesDependency
|
dependency37.type=UsesDependency
|
||||||
dependency38.from=Player
|
dependency38.from=Healthbar
|
||||||
dependency38.to=Spike
|
dependency38.to=Player
|
||||||
dependency38.type=UsesDependency
|
dependency38.type=UsesDependency
|
||||||
dependency39.from=Healthbar
|
dependency39.from=Plattform
|
||||||
dependency39.to=Player
|
dependency39.to=MyWorld
|
||||||
dependency39.type=UsesDependency
|
dependency39.type=UsesDependency
|
||||||
dependency4.from=MyWorld
|
dependency4.from=MyWorld
|
||||||
dependency4.to=Player
|
dependency4.to=Player
|
||||||
dependency4.type=UsesDependency
|
dependency4.type=UsesDependency
|
||||||
dependency40.from=Plattform
|
dependency40.from=Plattform
|
||||||
dependency40.to=MyWorld
|
dependency40.to=Player
|
||||||
dependency40.type=UsesDependency
|
dependency40.type=UsesDependency
|
||||||
dependency41.from=Plattform
|
dependency41.from=MovingPlattform
|
||||||
dependency41.to=Player
|
dependency41.to=MyWorld
|
||||||
dependency41.type=UsesDependency
|
dependency41.type=UsesDependency
|
||||||
dependency42.from=MovingPlattform
|
dependency42.from=MovingPlattform
|
||||||
dependency42.to=MyWorld
|
dependency42.to=Player
|
||||||
dependency42.type=UsesDependency
|
dependency42.type=UsesDependency
|
||||||
dependency43.from=MovingPlattform
|
dependency43.from=TemporaryGround
|
||||||
dependency43.to=Player
|
dependency43.to=Player
|
||||||
dependency43.type=UsesDependency
|
dependency43.type=UsesDependency
|
||||||
dependency44.from=TemporaryGround
|
dependency44.from=SpikedPlattform
|
||||||
dependency44.to=Player
|
dependency44.to=Spike
|
||||||
dependency44.type=UsesDependency
|
dependency44.type=UsesDependency
|
||||||
dependency45.from=SpikedPlattform
|
dependency45.from=SpikedPlattform
|
||||||
dependency45.to=Spike
|
dependency45.to=GameOverWorld
|
||||||
dependency45.type=UsesDependency
|
dependency45.type=UsesDependency
|
||||||
dependency46.from=SpikedPlattform
|
dependency46.from=SpikedPlattform
|
||||||
dependency46.to=GameOverWorld
|
dependency46.to=MyWorld
|
||||||
dependency46.type=UsesDependency
|
dependency46.type=UsesDependency
|
||||||
dependency47.from=SpikedPlattform
|
dependency47.from=SpikedPlattform
|
||||||
dependency47.to=MyWorld
|
dependency47.to=UnactiveSpike
|
||||||
dependency47.type=UsesDependency
|
dependency47.type=UsesDependency
|
||||||
dependency48.from=SpikedPlattform
|
dependency48.from=TargetingProjectile
|
||||||
dependency48.to=UnactiveSpike
|
dependency48.to=Player
|
||||||
dependency48.type=UsesDependency
|
dependency48.type=UsesDependency
|
||||||
dependency49.from=TargetingProjectile
|
dependency49.from=PlayerProjectile
|
||||||
dependency49.to=Player
|
dependency49.to=Enemy
|
||||||
dependency49.type=UsesDependency
|
dependency49.type=UsesDependency
|
||||||
dependency5.from=MyWorld
|
dependency5.from=MyWorld
|
||||||
dependency5.to=Score
|
dependency5.to=Score
|
||||||
dependency5.type=UsesDependency
|
dependency5.type=UsesDependency
|
||||||
dependency50.from=PlayerProjectile
|
|
||||||
dependency50.to=Enemy
|
|
||||||
dependency50.type=UsesDependency
|
|
||||||
dependency6.from=MyWorld
|
dependency6.from=MyWorld
|
||||||
dependency6.to=Plattform
|
dependency6.to=Plattform
|
||||||
dependency6.type=UsesDependency
|
dependency6.type=UsesDependency
|
||||||
@@ -161,12 +166,12 @@ dependency8.type=UsesDependency
|
|||||||
dependency9.from=MyWorld
|
dependency9.from=MyWorld
|
||||||
dependency9.to=TemporaryGround
|
dependency9.to=TemporaryGround
|
||||||
dependency9.type=UsesDependency
|
dependency9.type=UsesDependency
|
||||||
editor.fx.0.height=739
|
editor.fx.0.height=737
|
||||||
editor.fx.0.width=816
|
editor.fx.0.width=814
|
||||||
editor.fx.0.x=734
|
editor.fx.0.x=444
|
||||||
editor.fx.0.y=336
|
editor.fx.0.y=78
|
||||||
height=1048
|
height=830
|
||||||
package.numDependencies=50
|
package.numDependencies=49
|
||||||
package.numTargets=26
|
package.numTargets=26
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
@@ -181,7 +186,7 @@ readme.name=@README
|
|||||||
readme.width=49
|
readme.width=49
|
||||||
readme.x=10
|
readme.x=10
|
||||||
readme.y=10
|
readme.y=10
|
||||||
simulation.speed=52
|
simulation.speed=50
|
||||||
target1.height=70
|
target1.height=70
|
||||||
target1.name=Heart
|
target1.name=Heart
|
||||||
target1.showInterface=false
|
target1.showInterface=false
|
||||||
@@ -365,7 +370,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=1936
|
width=1550
|
||||||
world.lastInstantiated=StartWorld
|
world.lastInstantiated=MyWorld
|
||||||
xPosition=0
|
xPosition=0
|
||||||
yPosition=0
|
yPosition=0
|
||||||
|
|||||||
Reference in New Issue
Block a user