package main.entities;

import main.Main;
import main.SheetLoader;

public class Spider extends LivingEntity {

	private static SheetLoader loader = new SheetLoader("/res/images/spider_sprite_sheet.png", 32, 32, new int[] { 5, 3, 6, 9, 9, 8 });

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

		width = 0.7f;
		height = 0.8f;
		spriteOffsetY = -0.14f;
		spriteScale = 0.8f;
		posX = 4f;
		posY = 4f;
		
		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);
	}

	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";
	}

}
