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 CoinObj extends Entity {

    GamePanel panel;

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

        name = "Coin";
        type = EntityType.PICKUP;
        value = 1;
        down1 = initEntitySprites("/objects/coin_bronze");
    }

    public boolean use(Entity entity) {
        panel.playSE(1);
        panel.ui.addMessage("Coin +"+value);
        panel.player.coins += value;
        return true;
    }
}
