package me.hammerle.supersnuvi.tiles;

import me.hammerle.supersnuvi.entity.Entity;
import me.hammerle.supersnuvi.entity.Hero;
import me.hammerle.supersnuvi.util.CollisionBox;
import me.hammerle.supersnuvi.util.Face;

public class KillTile extends BaseTile
{
    private final double offsetY;
    
    public KillTile(String path, double offsetY) 
    {
        super(path);
        this.offsetY = offsetY;
        super.setCollisionBox(CollisionBox.createScaledBox(0.1, 0.1, 0.9, 0.9));
    }

    @Override
    public void onEntityCollide(Entity ent, int x, int y, Face face) 
    {
        super.onEntityCollide(ent, x, y, face);
        if(ent instanceof Hero)
        {
            ent.addHealth(-0.05);
        }
    }

    @Override
    public double getRenderOffsetY() 
    {
        return offsetY;
    }
}
