added game over screen
This commit is contained in:
@@ -125,6 +125,11 @@ public class Player extends Entity {
|
||||
invincible = false;
|
||||
invincibleCount = 0;
|
||||
}
|
||||
|
||||
if(life <= 0) {
|
||||
panel.gameState = GameState.GAMEOVER;
|
||||
panel.playSE(12);
|
||||
}
|
||||
}
|
||||
|
||||
// INTERACTION
|
||||
@@ -241,7 +246,7 @@ public class Player extends Entity {
|
||||
super.speak();
|
||||
}
|
||||
|
||||
// BACKGROUND CHECKS
|
||||
// BACKGROUND JOBS
|
||||
public void checkLevelUp() {
|
||||
if(exp < nextLevelExp) return;
|
||||
level++;
|
||||
@@ -274,6 +279,15 @@ public class Player extends Entity {
|
||||
inventory.remove(itemIndex);
|
||||
}
|
||||
}
|
||||
public void setDefaultPositions() {
|
||||
worldX = panel.tileSize * 23;
|
||||
worldY = panel.tileSize * 21;
|
||||
direction = Direction.DOWN;
|
||||
}
|
||||
public void restoreLife() {
|
||||
life = maxLife;
|
||||
invincible = false;
|
||||
}
|
||||
|
||||
// SETTING THINGS UP
|
||||
public void setDefaultValues() {
|
||||
@@ -298,6 +312,7 @@ public class Player extends Entity {
|
||||
defense = getDefense();
|
||||
|
||||
// INVENTORY
|
||||
inventory.clear();
|
||||
inventory.add(currentWeapon);
|
||||
inventory.add(currentShield);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user