summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-02 14:46:26 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-02 14:46:26 +0100
commit653b6113effbf7ba0ebf9607f95853b44c32ddb9 (patch)
tree3a8231c843416039821b21c7b18f27e182f78736 /core/src/ch/asynk/tankontank/engine
parentf9047c40b9c8c001c287317bea6ec7c58cbe456e (diff)
downloadRustAndDust-653b6113effbf7ba0ebf9607f95853b44c32ddb9.zip
RustAndDust-653b6113effbf7ba0ebf9607f95853b44c32ddb9.tar.gz
use promote_us.mp3 and promote_ge.mp3
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/PromoteAnimation.java15
1 files changed, 9 insertions, 6 deletions
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;
}