summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-03 23:41:03 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-03 23:41:03 +0100
commitaeaea5d86d3c5ca84562465c3989fef9949d6645 (patch)
tree96c6682c8504abb67725b522f2b7b590f0d12d2a /core/src/ch/asynk/tankontank/engine
parentd2538cfdf01bbcbaf28ebd254e6fc32fd2613f8a (diff)
downloadRustAndDust-aeaea5d86d3c5ca84562465c3989fef9949d6645.zip
RustAndDust-aeaea5d86d3c5ca84562465c3989fef9949d6645.tar.gz
add infantry_fire.png and infantry_fire.mp3, plug them in FireAnimation
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java14
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)