Fix Health
This commit is contained in:
+6
-11
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user