diff --git a/Zoelda/src/main/entities/Spider.java b/Zoelda/src/main/entities/Spider.java index 624ca51..b817a26 100644 --- a/Zoelda/src/main/entities/Spider.java +++ b/Zoelda/src/main/entities/Spider.java @@ -2,14 +2,14 @@ package main.entities; import main.Main; import main.SheetLoader; +import main.entities.player.Player; public class Spider extends LivingEntity { - private static SheetLoader loader = new SheetLoader("/res/images/spider_sprite_sheet.png", 32, 32, - new int[] { 5, 6, 9, 1, 4, 3, 9, 6, 5, 6, 9, 1, 4, 3, 9, 6 }); + 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), "walk"); + super(loader.getFigur(0), "idle"); width = 0.7f; height = 0.8f; @@ -17,27 +17,33 @@ public class Spider extends LivingEntity { 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() { - - // auf Kollisionen prüfen - checkTileCollisions(Main.instance.getWorld().getCurrentMap()); - // LivingEntity auch updaten lassen + Player player = Main.instance.getWorld().getCurrentMap().getPlayer(); + + this.checkTileCollisions(Main.instance.getWorld().getCurrentMap()); super.update(); - velX = 0; - velY = 0; } @Override public String getDeathAnimationName() { - return null; + return "die"; } @Override public String getDamageAnimationName() { - return null; + return "damage"; } } diff --git a/Zoelda/src/res/images/spider_sprite_sheet.png b/Zoelda/src/res/images/spider_sprite_sheet.png index 89de203..82a546c 100644 Binary files a/Zoelda/src/res/images/spider_sprite_sheet.png and b/Zoelda/src/res/images/spider_sprite_sheet.png differ