diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java index 26c8e6c..a13c234 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java @@ -9,27 +9,34 @@ public class FireAnimation { public static Random random = new Random(); + public static Sprites infantryFire; public static Sprites tankFire; public static Sprites explosion; + public static Sound infantryFireSnd; public static Sound tankFireSnd; public static Sound tankFireSndLong; public static Sound explosionSnd; public static Sound explosionSndLong; + public static double infantryFireSndLongId; public static double tankFireSndLongId; public static double explosionSndLongId; public static void init( + Texture infantryFireT, int iCols, int iRows, Texture tankFireT, int sCols, int sRows, Texture explosionT, int eCols, int eRows, + Sound infantryFireS, Sound tankFireS, Sound tankFireLongS, Sound explosionS, Sound explosionLongS) { + infantryFire = new Sprites(infantryFireT, iCols, iRows); tankFire = new Sprites(tankFireT, sCols, sRows); explosion = new Sprites(explosionT, eCols, eRows); + infantryFireSnd = infantryFireS; tankFireSnd = tankFireS; tankFireSndLong = tankFireLongS; explosionSnd = explosionS; @@ -40,6 +47,7 @@ public class FireAnimation public static void reset() { + infantryFireSndLongId = -1; tankFireSndLongId = -1; explosionSndLongId = -1; } @@ -55,6 +63,12 @@ public class FireAnimation explosionSndLong.dispose(); } + public static void infantryFireSndPlay(float volume) + { + if (infantryFireSndLongId == -1) + infantryFireSndLongId = infantryFireSnd.play(volume); + } + public static void tankFireSndPlay(float volume) { if (tankFireSndLongId == -1) |