added player life display

This commit is contained in:
2025-11-28 21:22:50 +01:00
parent 5fbf815595
commit 8add9c7d7a
5 changed files with 77 additions and 3 deletions

View File

@@ -28,6 +28,10 @@ public class Entity {
String[] dialogue = new String[20];
int dialogueIndex = 0;
// CHARACTER STATUS
public int maxLife;
public int life;
public Entity(GamePanel panel) {
this.panel = panel;
}

View File

@@ -38,6 +38,10 @@ public class Player extends Entity {
worldY = panel.tileSize * 21;
speed = 4;
direction = Direction.DOWN;
// PLAYER STATUS (1 heart = 2 lives)
maxLife = 6;
life = maxLife;
}
public void getPlayerImage() {