package net.gpdev.darkly;

import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

import static net.gpdev.darkly.DarklyGame.FLASHLIGHT;

public class PlayerEntity extends GameEntity {

    private float flashlightRotation = 0;

    public PlayerEntity(Sprite sprite, Vector2 position, float speed, Rectangle boundingBox) {
        super(sprite, position, speed, boundingBox);
    }

    public void toggleFlashlight() {
        lights.get(FLASHLIGHT).toggle();
    }

    @Override
    public void update(float delta) {
        super.update(delta);

        // Compute flashlight rotation
        if (!velocity.isZero()) {
            flashlightRotation = velocity.angle() - 90;
        }
        lights.get(FLASHLIGHT).getSprite().setRotation(flashlightRotation);
    }
}

@@ -288,16 +288,77 @@
 ion = 0;
+%0A    private int health = 100;%0A    private int battery = 100;
 %0A%0A    pu
@@ -587,24 +587,154 @@
 e();%0A    %7D%0A%0A
+    public int getHealthLevel() %7B%0A        return health;%0A    %7D%0A%0A    public int getBatteryLevel() %7B%0A        return battery;%0A    %7D%0A%0A
     @Overrid

Add health & battery levels to PlayerEntity