Fix Health

This commit is contained in:
2026-09-16 17:26:16 +02:00
parent eba1e4567e
commit f7f611c2ae
3 changed files with 138 additions and 129 deletions
+6 -11
View File
@@ -13,10 +13,10 @@ public class Player extends Actor
int jumpBoostDuration = -1;
int jumpBoostStrength = 5;
boolean projectileReady = false;
int projectileTimer;
private int speed = 6;
private int currentJumpStrength;
private int defaultJumpStrength = 15;
@@ -93,8 +93,8 @@ public class Player extends Actor
}
}
onGround = landed;
}
}
public void shootProjectile(){
projectileTimer++;
MouseInfo mouse = Greenfoot.getMouseInfo();
@@ -124,14 +124,9 @@ public class Player extends Actor
public void checkHealth(){
if (health <= 0){
Greenfoot.setWorld(new GameOverWorld());
return true;
}
else
{
return false;
}
}
public void handlePowerUps(){
if (jumpBoostDuration >= 0){
jumpBoostDuration -= 1;
@@ -139,7 +134,7 @@ public class Player extends Actor
currentJumpStrength = defaultJumpStrength;
}
}
public void reveivePowerUp(int duration, String type){
switch(type){
case "dummy":