diff --git a/Zoelda/src/main/LivingEntity.java b/Zoelda/src/main/LivingEntity.java index b517a25..c58d6d4 100644 --- a/Zoelda/src/main/LivingEntity.java +++ b/Zoelda/src/main/LivingEntity.java @@ -12,7 +12,7 @@ public class LivingEntity extends Entity { protected ActionFigur actionFigur; // Sprite des Entities protected float spriteScale = 1f; // Skalierung des Sprites protected float spriteOffsetX, spriteOffsetY; // Offset des Sprites. Hier kann man die relative render-Position nachjustieren. - + protected float hp; //hp des Entitys /** * @param figur - erstes (standart) Sprite * @param name - name des Zustands @@ -70,4 +70,8 @@ public class LivingEntity extends Entity { actionFigur.spiegelXSetzen(side); actionFigur.zustandSetzen(name); } + + protected float getHealthPoints() { + return hp; + } } diff --git a/Zoelda/src/main/Player.java b/Zoelda/src/main/Player.java index 8245eeb..845e49b 100644 --- a/Zoelda/src/main/Player.java +++ b/Zoelda/src/main/Player.java @@ -18,7 +18,8 @@ public class Player extends LivingEntity { spriteScale = 0.8f; posX = 4f; posY = 4f; - + hp = 10f; + // unterschiedliche Animationsgeschwindigkeiten // für idle loader.getPlayer(0).animationsGeschwindigkeitSetzen(200);