From aaaca59dfccfe0ed166aa812bb994b4217787ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lacz=C3=B3=20D=C3=A1vid=20Bence?= <therex92@hotmail.com> Date: Fri, 9 May 2014 17:26:15 +0200 Subject: [PATCH] SOUNDS! --- src/world/Enemy.java | 8 ++++++++ src/world/World.java | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/world/Enemy.java b/src/world/Enemy.java index aca632a..5885e33 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 255e219..e9d8d32 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 -- GitLab