From 05968c6347a66d62767d1bc49f1a7799b3b5cd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 18 Jan 2015 23:08:30 +0100 Subject: Map: extract playMoveSound(Unit) out of startMove(Unit) --- core/src/ch/asynk/tankontank/game/Map.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.1-2-g2b99