summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-18 23:08:30 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-18 23:08:30 +0100
commit05968c6347a66d62767d1bc49f1a7799b3b5cd00 (patch)
treef33558f42fe6970dc23ff1f1b1f75311649ecae3 /core
parent05cd151256d038f838f69bec4d1935f213ad3544 (diff)
downloadRustAndDust-05968c6347a66d62767d1bc49f1a7799b3b5cd00.zip
RustAndDust-05968c6347a66d62767d1bc49f1a7799b3b5cd00.tar.gz
Map: extract playMoveSound(Unit) out of startMove(Unit)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index ca1fffd..eca6e64 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -354,12 +354,17 @@ public abstract class Map extends Board
{
moveableUnits.remove(unit);
activatedUnits.add(unit);
+ playMoveSound(unit);
+ return moveableUnits.size();
+ }
+
+ private void playMoveSound(Unit unit)
+ {
if (unit.isA(Unit.UnitType.INFANTRY))
sound = infantryMoveSound;
else
sound = tankMoveSound;
soundId = sound.play(ctrl.cfg.fxVolume);
- return moveableUnits.size();
}
private RunnableAnimation notifyDoneAnimation(final Unit unit)