Skip to content
Snippets Groups Projects
Commit aaaca59d authored by Laczó Dávid Bence's avatar Laczó Dávid Bence
Browse files

SOUNDS!

parent 5f1abd62
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ import java.util.ArrayList; ...@@ -7,6 +7,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Random; import java.util.Random;
import view.Sounds;
public class Enemy extends Placeable implements ITickable { public class Enemy extends Placeable implements ITickable {
private int hp; private int hp;
private int moveTimeLeft; private int moveTimeLeft;
...@@ -43,6 +45,12 @@ public class Enemy extends Placeable implements ITickable { ...@@ -43,6 +45,12 @@ public class Enemy extends Placeable implements ITickable {
{ {
field.getWorld().notifyEnemyDied(this); field.getWorld().notifyEnemyDied(this);
field.stepOff(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() { public EnemyType getType() {
......
...@@ -199,7 +199,6 @@ public class World implements IEnemyObserver { ...@@ -199,7 +199,6 @@ public class World implements IEnemyObserver {
engine.end(true); engine.end(true);
} }
engine.removeTickable(enemy); engine.removeTickable(enemy);
Sounds.PlaySound("src\\resources\\dwarf_dead.wav");
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment