Merge remote-tracking branch 'origin/main'
# Conflicts: # SMIMS-Game/MyWorld.class # SMIMS-Game/MyWorld.java # SMIMS-Game/project.greenfoot
This commit is contained in:
Binary file not shown.
Binary file not shown.
+13
-2
@@ -81,7 +81,7 @@ public class Player extends Actor
|
|||||||
java.util.List<Plattform> platforms = getIntersectingObjects(Plattform.class);
|
java.util.List<Plattform> platforms = getIntersectingObjects(Plattform.class);
|
||||||
boolean landed = false;
|
boolean landed = false;
|
||||||
for (Plattform platform : platforms) {
|
for (Plattform platform : platforms) {
|
||||||
int groundTop = platform.getY() - platform.getImage().getHeight() / 2;
|
int groundTop = platform.getY()+5 - platform.getImage().getHeight() / 2;
|
||||||
int characterBottom = getY() + getImage().getHeight() / 2;
|
int characterBottom = getY() + getImage().getHeight() / 2;
|
||||||
int oldCharacterBottom = oldY + getImage().getHeight() / 2;
|
int oldCharacterBottom = oldY + getImage().getHeight() / 2;
|
||||||
// Prüfen, ob der Spieler von oben auf diese Plattform fällt
|
// Prüfen, ob der Spieler von oben auf diese Plattform fällt
|
||||||
@@ -121,7 +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));
|
||||||
getWorld().removeObject(getWorld().getObjects(Heart.class).get(0));
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class.MovingPlattform.image=Platform1.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=PlayerProjectile.png
|
class.PlayerProjectile.image=beeper.png
|
||||||
class.Projectile.image=Projectile1.png
|
class.Projectile.image=Projectile1.png
|
||||||
class.Spike.image=singleSpike.png
|
class.Spike.image=singleSpike.png
|
||||||
class.SpikedPlattform.image=Spikes2.png
|
class.SpikedPlattform.image=Spikes2.png
|
||||||
@@ -48,105 +48,111 @@ dependency16.type=UsesDependency
|
|||||||
dependency17.from=StartWorld
|
dependency17.from=StartWorld
|
||||||
dependency17.to=Button
|
dependency17.to=Button
|
||||||
dependency17.type=UsesDependency
|
dependency17.type=UsesDependency
|
||||||
dependency18.from=UnactiveSpike
|
dependency18.from=StartWorld
|
||||||
dependency18.to=SpikedPlattform
|
dependency18.to=Button
|
||||||
dependency18.type=UsesDependency
|
dependency18.type=UsesDependency
|
||||||
dependency19.from=UnactiveSpike
|
dependency19.from=UnactiveSpike
|
||||||
dependency19.to=MyWorld
|
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=UnactiveSpike
|
dependency20.from=UnactiveSpike
|
||||||
dependency20.to=Spike
|
dependency20.to=MyWorld
|
||||||
dependency20.type=UsesDependency
|
dependency20.type=UsesDependency
|
||||||
dependency21.from=Button
|
dependency21.from=UnactiveSpike
|
||||||
dependency21.to=MyWorld
|
dependency21.to=Spike
|
||||||
dependency21.type=UsesDependency
|
dependency21.type=UsesDependency
|
||||||
dependency22.from=PowerUps
|
dependency22.from=Button
|
||||||
dependency22.to=Player
|
dependency22.to=MyWorld
|
||||||
dependency22.type=UsesDependency
|
dependency22.type=UsesDependency
|
||||||
dependency23.from=HealthItem
|
dependency23.from=PowerUps
|
||||||
dependency23.to=Player
|
dependency23.to=Player
|
||||||
dependency23.type=UsesDependency
|
dependency23.type=UsesDependency
|
||||||
dependency24.from=JumpBoostItem
|
dependency24.from=HealthItem
|
||||||
dependency24.to=Player
|
dependency24.to=Player
|
||||||
dependency24.type=UsesDependency
|
dependency24.type=UsesDependency
|
||||||
dependency25.from=Groundflower
|
dependency25.from=JumpBoostItem
|
||||||
dependency25.to=Player
|
dependency25.to=Player
|
||||||
dependency25.type=UsesDependency
|
dependency25.type=UsesDependency
|
||||||
dependency26.from=Enemy
|
dependency26.from=Groundflower
|
||||||
dependency26.to=Player
|
dependency26.to=Player
|
||||||
dependency26.type=UsesDependency
|
dependency26.type=UsesDependency
|
||||||
dependency27.from=Enemy
|
dependency27.from=Enemy
|
||||||
dependency27.to=EnemyProjectile
|
dependency27.to=Player
|
||||||
dependency27.type=UsesDependency
|
dependency27.type=UsesDependency
|
||||||
dependency28.from=Spike
|
dependency28.from=Enemy
|
||||||
dependency28.to=MyWorld
|
dependency28.to=EnemyProjectile
|
||||||
dependency28.type=UsesDependency
|
dependency28.type=UsesDependency
|
||||||
dependency29.from=Player
|
dependency29.from=Spike
|
||||||
dependency29.to=GameOverWorld
|
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=Player
|
dependency30.from=Player
|
||||||
dependency30.to=Plattform
|
dependency30.to=GameOverWorld
|
||||||
dependency30.type=UsesDependency
|
dependency30.type=UsesDependency
|
||||||
dependency31.from=Player
|
dependency31.from=Player
|
||||||
dependency31.to=PlayerProjectile
|
dependency31.to=Plattform
|
||||||
dependency31.type=UsesDependency
|
dependency31.type=UsesDependency
|
||||||
dependency32.from=Player
|
dependency32.from=Player
|
||||||
dependency32.to=TemporaryGround
|
dependency32.to=PlayerProjectile
|
||||||
dependency32.type=UsesDependency
|
dependency32.type=UsesDependency
|
||||||
dependency33.from=Player
|
dependency33.from=Player
|
||||||
dependency33.to=Projectile
|
dependency33.to=TemporaryGround
|
||||||
dependency33.type=UsesDependency
|
dependency33.type=UsesDependency
|
||||||
dependency34.from=Player
|
dependency34.from=Player
|
||||||
dependency34.to=Enemy
|
dependency34.to=Projectile
|
||||||
dependency34.type=UsesDependency
|
dependency34.type=UsesDependency
|
||||||
dependency35.from=Player
|
dependency35.from=Player
|
||||||
dependency35.to=Spike
|
dependency35.to=Enemy
|
||||||
dependency35.type=UsesDependency
|
dependency35.type=UsesDependency
|
||||||
dependency36.from=Player
|
dependency36.from=Player
|
||||||
dependency36.to=Heart
|
dependency36.to=Spike
|
||||||
dependency36.type=UsesDependency
|
dependency36.type=UsesDependency
|
||||||
dependency37.from=Plattform
|
dependency37.from=Player
|
||||||
dependency37.to=MyWorld
|
dependency37.to=Heart
|
||||||
dependency37.type=UsesDependency
|
dependency37.type=UsesDependency
|
||||||
dependency38.from=Plattform
|
dependency38.from=Healthbar
|
||||||
dependency38.to=Player
|
dependency38.to=Player
|
||||||
dependency38.type=UsesDependency
|
dependency38.type=UsesDependency
|
||||||
dependency39.from=MovingPlattform
|
dependency39.from=Plattform
|
||||||
dependency39.to=MyWorld
|
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=MovingPlattform
|
dependency40.from=Plattform
|
||||||
dependency40.to=Player
|
dependency40.to=Player
|
||||||
dependency40.type=UsesDependency
|
dependency40.type=UsesDependency
|
||||||
dependency41.from=TemporaryGround
|
dependency41.from=MovingPlattform
|
||||||
dependency41.to=Player
|
dependency41.to=MyWorld
|
||||||
dependency41.type=UsesDependency
|
dependency41.type=UsesDependency
|
||||||
dependency42.from=SpikedPlattform
|
dependency42.from=MovingPlattform
|
||||||
dependency42.to=Spike
|
dependency42.to=Player
|
||||||
dependency42.type=UsesDependency
|
dependency42.type=UsesDependency
|
||||||
dependency43.from=SpikedPlattform
|
dependency43.from=TemporaryGround
|
||||||
dependency43.to=GameOverWorld
|
dependency43.to=Player
|
||||||
dependency43.type=UsesDependency
|
dependency43.type=UsesDependency
|
||||||
dependency44.from=SpikedPlattform
|
dependency44.from=SpikedPlattform
|
||||||
dependency44.to=MyWorld
|
dependency44.to=Spike
|
||||||
dependency44.type=UsesDependency
|
dependency44.type=UsesDependency
|
||||||
dependency45.from=SpikedPlattform
|
dependency45.from=SpikedPlattform
|
||||||
dependency45.to=UnactiveSpike
|
dependency45.to=GameOverWorld
|
||||||
dependency45.type=UsesDependency
|
dependency45.type=UsesDependency
|
||||||
dependency46.from=TargetingProjectile
|
dependency46.from=SpikedPlattform
|
||||||
dependency46.to=Player
|
dependency46.to=MyWorld
|
||||||
dependency46.type=UsesDependency
|
dependency46.type=UsesDependency
|
||||||
dependency47.from=PlayerProjectile
|
dependency47.from=SpikedPlattform
|
||||||
dependency47.to=Enemy
|
dependency47.to=UnactiveSpike
|
||||||
dependency47.type=UsesDependency
|
dependency47.type=UsesDependency
|
||||||
|
dependency48.from=TargetingProjectile
|
||||||
|
dependency48.to=Player
|
||||||
|
dependency48.type=UsesDependency
|
||||||
|
dependency49.from=PlayerProjectile
|
||||||
|
dependency49.to=Enemy
|
||||||
|
dependency49.type=UsesDependency
|
||||||
dependency5.from=MyWorld
|
dependency5.from=MyWorld
|
||||||
dependency5.to=Score
|
dependency5.to=Score
|
||||||
dependency5.type=UsesDependency
|
dependency5.type=UsesDependency
|
||||||
@@ -154,21 +160,21 @@ dependency6.from=MyWorld
|
|||||||
dependency6.to=Plattform
|
dependency6.to=Plattform
|
||||||
dependency6.type=UsesDependency
|
dependency6.type=UsesDependency
|
||||||
dependency7.from=MyWorld
|
dependency7.from=MyWorld
|
||||||
dependency7.to=Heart
|
dependency7.to=Healthbar
|
||||||
dependency7.type=UsesDependency
|
dependency7.type=UsesDependency
|
||||||
dependency8.from=MyWorld
|
dependency8.from=MyWorld
|
||||||
dependency8.to=TemporaryGround
|
dependency8.to=Heart
|
||||||
dependency8.type=UsesDependency
|
dependency8.type=UsesDependency
|
||||||
dependency9.from=MyWorld
|
dependency9.from=MyWorld
|
||||||
dependency9.to=MovingPlattform
|
dependency9.to=TemporaryGround
|
||||||
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=535
|
editor.fx.0.x=444
|
||||||
editor.fx.0.y=44
|
editor.fx.0.y=78
|
||||||
height=822
|
height=830
|
||||||
package.numDependencies=47
|
package.numDependencies=49
|
||||||
package.numTargets=25
|
package.numTargets=26
|
||||||
project.charset=UTF-8
|
project.charset=UTF-8
|
||||||
publish.hasSource=false
|
publish.hasSource=false
|
||||||
publish.locked=true
|
publish.locked=true
|
||||||
@@ -240,21 +246,21 @@ target16.width=120
|
|||||||
target16.x=0
|
target16.x=0
|
||||||
target16.y=0
|
target16.y=0
|
||||||
target17.height=70
|
target17.height=70
|
||||||
target17.name=BreakingPlattform
|
target17.name=Healthbar
|
||||||
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=GameOverWorld
|
target18.name=BreakingPlattform
|
||||||
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.height=70
|
||||||
target19.name=StartWorld
|
target19.name=GameOverWorld
|
||||||
target19.showInterface=false
|
target19.showInterface=false
|
||||||
target19.type=ClassTarget
|
target19.type=ClassTarget
|
||||||
target19.width=120
|
target19.width=120
|
||||||
@@ -268,47 +274,54 @@ target2.width=120
|
|||||||
target2.x=0
|
target2.x=0
|
||||||
target2.y=0
|
target2.y=0
|
||||||
target20.height=70
|
target20.height=70
|
||||||
target20.name=Plattform
|
target20.name=StartWorld
|
||||||
target20.showInterface=false
|
target20.showInterface=false
|
||||||
target20.type=ClassTarget
|
target20.type=ClassTarget
|
||||||
target20.width=120
|
target20.width=120
|
||||||
target20.x=0
|
target20.x=0
|
||||||
target20.y=0
|
target20.y=0
|
||||||
target21.height=70
|
target21.height=70
|
||||||
target21.name=Projectile
|
target21.name=Plattform
|
||||||
target21.showInterface=false
|
target21.showInterface=false
|
||||||
target21.type=ClassTarget
|
target21.type=ClassTarget
|
||||||
target21.width=120
|
target21.width=120
|
||||||
target21.x=0
|
target21.x=0
|
||||||
target21.y=0
|
target21.y=0
|
||||||
target22.height=70
|
target22.height=70
|
||||||
target22.name=Score
|
target22.name=Projectile
|
||||||
target22.showInterface=false
|
target22.showInterface=false
|
||||||
target22.type=ClassTarget
|
target22.type=ClassTarget
|
||||||
target22.width=120
|
target22.width=120
|
||||||
target22.x=0
|
target22.x=0
|
||||||
target22.y=0
|
target22.y=0
|
||||||
target23.height=70
|
target23.height=70
|
||||||
target23.name=EnemyProjectile
|
target23.name=Score
|
||||||
target23.showInterface=false
|
target23.showInterface=false
|
||||||
target23.type=ClassTarget
|
target23.type=ClassTarget
|
||||||
target23.width=120
|
target23.width=120
|
||||||
target23.x=0
|
target23.x=0
|
||||||
target23.y=0
|
target23.y=0
|
||||||
target24.height=70
|
target24.height=70
|
||||||
target24.name=PlayerProjectile
|
target24.name=EnemyProjectile
|
||||||
target24.showInterface=false
|
target24.showInterface=false
|
||||||
target24.type=ClassTarget
|
target24.type=ClassTarget
|
||||||
target24.width=120
|
target24.width=120
|
||||||
target24.x=0
|
target24.x=0
|
||||||
target24.y=0
|
target24.y=0
|
||||||
target25.height=70
|
target25.height=70
|
||||||
target25.name=SpikedPlattform
|
target25.name=PlayerProjectile
|
||||||
target25.showInterface=false
|
target25.showInterface=false
|
||||||
target25.type=ClassTarget
|
target25.type=ClassTarget
|
||||||
target25.width=120
|
target25.width=120
|
||||||
target25.x=0
|
target25.x=0
|
||||||
target25.y=0
|
target25.y=0
|
||||||
|
target26.height=70
|
||||||
|
target26.name=SpikedPlattform
|
||||||
|
target26.showInterface=false
|
||||||
|
target26.type=ClassTarget
|
||||||
|
target26.width=120
|
||||||
|
target26.x=0
|
||||||
|
target26.y=0
|
||||||
target3.height=70
|
target3.height=70
|
||||||
target3.name=Ground
|
target3.name=Ground
|
||||||
target3.showInterface=false
|
target3.showInterface=false
|
||||||
|
|||||||
Reference in New Issue
Block a user