package main.entities;

import main.Main;
import main.SheetLoader;
import main.entities.player.Player;

public class Snake extends LivingEntity {

	private static SheetLoader loader = new SheetLoader("/res/images/snake_spritesheet_calciumtrice.png", 32, 32, new int[] { 10, 10, 10, 10, 13, 8 });

	public Snake() {
		super(loader.getFigur(0), "idle");

		posX = 9f;
		posY = 9f;
		accelleration = 0.006f;
		spriteOffsetY = -0.6f;
		width = 0.65f;
		height = 0.8f;
		mirrored = true;

		actionFigur.neuerZustand(loader.getFigur(1), "lost_sight");
		actionFigur.neuerZustand(loader.getFigur(2), "walk");
		actionFigur.neuerZustand(loader.getFigur(3), "attack");
		actionFigur.neuerZustand(loader.getFigur(4), getDeathAnimationName());
		actionFigur.neuerZustand(loader.getFigur(5), getDamageAnimationName());

		loader.getFigur(3).animationsGeschwindigkeitSetzen(80);
		loader.getFigur(5).animationsGeschwindigkeitSetzen(40);
	}

	@Override
	protected void update() {
		Player player = Main.instance.getWorld().getCurrentMap().getPlayer();
		
		this.checkTileCollisions(Main.instance.getWorld().getCurrentMap());
		super.update();
	}

	@Override
	public String getDeathAnimationName() {
		return "die";
	}

	@Override
	public String getDamageAnimationName() {
		return "damage";
	}
}
