package de.miaurizius.jgame2d.entity.item;

import de.miaurizius.jgame2d.core.GamePanel;
import de.miaurizius.jgame2d.core.enums.EntityType;
import de.miaurizius.jgame2d.entity.Entity;

public class HeartObj extends Entity {

    GamePanel panel;

    public HeartObj(GamePanel panel) {
        super(panel);
        this.panel = panel;

        name = "Heart";
        type = EntityType.PICKUP;
        value = 2;

        down1 = initEntitySprites("objects/heart_full");
        image = initEntitySprites("objects/heart_full");
        image2 = initEntitySprites("objects/heart_half");
        image3 = initEntitySprites("objects/heart_blank");
    }

    @Override
    public boolean use(Entity entity) {
        panel.playSE(2);
        panel.ui.addMessage("Life +"+value);
        entity.life += value;
        return true;
    }

}
