From 653b6113effbf7ba0ebf9607f95853b44c32ddb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 2 Jan 2015 14:46:26 +0100 Subject: use promote_us.mp3 and promote_ge.mp3 --- android/assets/sounds/promote.mp3 | Bin 21732 -> 0 bytes android/assets/sounds/promote_ge.mp3 | Bin 0 -> 19225 bytes android/assets/sounds/promote_us.mp3 | Bin 0 -> 21732 bytes assets/sounds/promote.mp3 | Bin 21732 -> 0 bytes assets/sounds/promote_ge.mp3 | Bin 0 -> 19225 bytes assets/sounds/promote_us.mp3 | Bin 0 -> 21732 bytes core/src/ch/asynk/tankontank/TankOnTank.java | 6 ++++-- .../engine/gfx/animations/PromoteAnimation.java | 15 +++++++++------ core/src/ch/asynk/tankontank/game/Map.java | 6 ++++-- 9 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 android/assets/sounds/promote.mp3 create mode 100644 android/assets/sounds/promote_ge.mp3 create mode 100644 android/assets/sounds/promote_us.mp3 delete mode 100644 assets/sounds/promote.mp3 create mode 100644 assets/sounds/promote_ge.mp3 create mode 100644 assets/sounds/promote_us.mp3 diff --git a/android/assets/sounds/promote.mp3 b/android/assets/sounds/promote.mp3 deleted file mode 100644 index 434ddec..0000000 Binary files a/android/assets/sounds/promote.mp3 and /dev/null differ diff --git a/android/assets/sounds/promote_ge.mp3 b/android/assets/sounds/promote_ge.mp3 new file mode 100644 index 0000000..7c55e24 Binary files /dev/null and b/android/assets/sounds/promote_ge.mp3 differ diff --git a/android/assets/sounds/promote_us.mp3 b/android/assets/sounds/promote_us.mp3 new file mode 100644 index 0000000..434ddec Binary files /dev/null and b/android/assets/sounds/promote_us.mp3 differ diff --git a/assets/sounds/promote.mp3 b/assets/sounds/promote.mp3 deleted file mode 100644 index 434ddec..0000000 Binary files a/assets/sounds/promote.mp3 and /dev/null differ diff --git a/assets/sounds/promote_ge.mp3 b/assets/sounds/promote_ge.mp3 new file mode 100644 index 0000000..7c55e24 Binary files /dev/null and b/assets/sounds/promote_ge.mp3 differ diff --git a/assets/sounds/promote_us.mp3 b/assets/sounds/promote_us.mp3 new file mode 100644 index 0000000..434ddec Binary files /dev/null and b/assets/sounds/promote_us.mp3 differ 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() { -- cgit v1.1-2-g2b99