diff --git a/src/world/Enemy.java b/src/world/Enemy.java index aca632af77b51a2a422191e9bd22b6f4d947ddec..5885e33686dd8ff11752de037a0f4687421e5bc9 100644 --- a/src/world/Enemy.java +++ b/src/world/Enemy.java @@ -7,6 +7,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Random; +import view.Sounds; + public class Enemy extends Placeable implements ITickable { private int hp; private int moveTimeLeft; @@ -43,6 +45,12 @@ public class Enemy extends Placeable implements ITickable { { field.getWorld().notifyEnemyDied(this); field.stepOff(this); + if(this.type == EnemyType.HUMAN) + Sounds.PlaySound("src\\resources\\human_dead.wav"); + if(this.type == EnemyType.DWARF) + Sounds.PlaySound("src\\resources\\dwarf_dead.wav"); + if(this.type == EnemyType.HOBBIT) + Sounds.PlaySound("src\\resources\\hobbit_dead.wav"); } public EnemyType getType() { diff --git a/src/world/World.java b/src/world/World.java index 255e219dd3830da521558d344d6a9b3a81497320..e9d8d32469d45e81859aa6971d23b04a2c613945 100644 --- a/src/world/World.java +++ b/src/world/World.java @@ -199,7 +199,6 @@ public class World implements IEnemyObserver { engine.end(true); } engine.removeTickable(enemy); - Sounds.PlaySound("src\\resources\\dwarf_dead.wav"); } } \ No newline at end of file