diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/TankOnTank.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java | 15 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 6 |
3 files changed, 17 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java index 0d3ed9d..422406e 100644 --- a/core/src/ch/asynk/tankontank/TankOnTank.java +++ b/core/src/ch/asynk/tankontank/TankOnTank.java @@ -104,7 +104,8 @@ public class TankOnTank extends Game manager.load("sounds/tank_fire_short.mp3", Sound.class); manager.load("sounds/explosion.mp3", Sound.class); manager.load("sounds/explosion_short.mp3", Sound.class); - manager.load("sounds/promote.mp3", Sound.class); + manager.load("sounds/promote_us.mp3", Sound.class); + manager.load("sounds/promote_ge.mp3", Sound.class); debug("TankOnTank", " assets loaded : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB"); } @@ -131,7 +132,8 @@ public class TankOnTank extends Game manager.unload("sounds/tank_fire_short.mp3"); manager.unload("sounds/explosion.mp3"); manager.unload("sounds/explosion_short.mp3"); - manager.unload("sounds/promote.mp3"); + manager.unload("sounds/promote_us.mp3"); + manager.unload("sounds/promote_ge.mp3"); debug("TankOnTank", " assets unloaded : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB"); } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java index 099946f..9694f33 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java @@ -15,7 +15,9 @@ public class PromoteAnimation implements Animation, Drawable private static final float DURATION = 0.3f; - private static Sound sound; + private static Sound usSound; + private static Sound geSound; + private static Sound snd; private static TextureRegion region; private float x; @@ -27,22 +29,22 @@ public class PromoteAnimation implements Animation, Drawable private float volume; private float elapsed; - public static void init(TextureAtlas atlas, Sound snd) + public static void init(TextureAtlas atlas, Sound usSnd, Sound geSnd) { region = atlas.findRegion("stars"); - sound = snd; + usSound = usSnd; + geSound = geSnd; } public static void free() { - sound.dispose(); } protected void PromoteAnimation() { } - public static PromoteAnimation get(float x0, float y0, float x1, float y1, float v) + public static PromoteAnimation get(boolean us, float x0, float y0, float x1, float y1, float v) { x0 = (x0 - (region.getRegionWidth() / 2.0f)); y0 = (y0 - (region.getRegionHeight() / 2.0f)); @@ -57,6 +59,7 @@ public class PromoteAnimation implements Animation, Drawable instance.dx = ((x1 - x0)/ DURATION); instance.dy = ((y1 - y0) / DURATION); instance.elapsed = 0f; + snd = (us ? usSound : geSound); return instance; } @@ -73,7 +76,7 @@ public class PromoteAnimation implements Animation, Drawable if (elapsed >= DURATION) { x = x1; y = y1; - sound.play(volume); + snd.play(volume); return true; } diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index fa47423..2866e4c 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -106,7 +106,9 @@ public abstract class Map extends Board this.tankMoveSound = game.manager.get("sounds/tank_move.mp3", Sound.class); this.infantryMoveSound = game.manager.get("sounds/infantry_move.mp3", Sound.class); DiceAnimation.init(game.manager.get("data/dice.png", Texture.class), 16, 9, game.manager.get("sounds/dice.mp3", Sound.class)); - PromoteAnimation.init(game.manager.get("data/hud.atlas", TextureAtlas.class), game.manager.get("sounds/promote.mp3", Sound.class)); + PromoteAnimation.init(game.manager.get("data/hud.atlas", TextureAtlas.class), + game.manager.get("sounds/promote_us.mp3", Sound.class), + game.manager.get("sounds/promote_ge.mp3", Sound.class)); FireAnimation.init( game.manager.get("data/infantry_fire.png", Texture.class), 1, 8, game.manager.get("data/tank_fire.png", Texture.class), 1, 8, @@ -305,7 +307,7 @@ public abstract class Map extends Board Hex hex = unit.getHex(); AnimationSequence seq = AnimationSequence.get(2); - seq.addAnimation(PromoteAnimation.get(x, y, hex.getX(), hex.getY(), ctrl.cfg.fxVolume)); + seq.addAnimation(PromoteAnimation.get((unit.getArmy() == Army.US), x, y, hex.getX(), hex.getY(), ctrl.cfg.fxVolume)); seq.addAnimation ( RunnableAnimation.get(unit, new Runnable() { @Override public void run() { |