summaryrefslogtreecommitdiffstats
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
parentd2538cfdf01bbcbaf28ebd254e6fc32fd2613f8a (diff)
downloadRustAndDust-aeaea5d86d3c5ca84562465c3989fef9949d6645.zip
RustAndDust-aeaea5d86d3c5ca84562465c3989fef9949d6645.tar.gz
add infantry_fire.png and infantry_fire.mp3, plug them in FireAnimation
-rw-r--r--android/assets/data/infantry_fire.pngbin0 -> 1449 bytes
-rw-r--r--android/assets/sounds/infantry_fire.mp3bin0 -> 44446 bytes
-rw-r--r--core/src/ch/asynk/tankontank/TankOnTank.java4
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/FireAnimation.java14
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java4
5 files changed, 21 insertions, 1 deletions
diff --git a/android/assets/data/infantry_fire.png b/android/assets/data/infantry_fire.png
new file mode 100644
index 0000000..a0a026d
--- /dev/null
+++ b/android/assets/data/infantry_fire.png
Binary files differ
diff --git a/android/assets/sounds/infantry_fire.mp3 b/android/assets/sounds/infantry_fire.mp3
new file mode 100644
index 0000000..7cf307c
--- /dev/null
+++ b/android/assets/sounds/infantry_fire.mp3
Binary files differ
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java
index 5b72827..2a7fde8 100644
--- a/core/src/ch/asynk/tankontank/TankOnTank.java
+++ b/core/src/ch/asynk/tankontank/TankOnTank.java
@@ -56,10 +56,12 @@ public class TankOnTank extends Game
manager.load("data/unit-overlays.atlas", TextureAtlas.class);
manager.load("data/hex-overlays.atlas", TextureAtlas.class);
manager.load("data/dice.png", Texture.class);
+ manager.load("data/infantry_fire.png", Texture.class);
manager.load("data/tank_fire.png", Texture.class);
manager.load("data/explosions.png", Texture.class);
manager.load("sounds/dice.mp3", Sound.class);
manager.load("sounds/move.mp3", Sound.class);
+ manager.load("sounds/infantry_fire.mp3", Sound.class);
manager.load("sounds/tank_fire.mp3", Sound.class);
manager.load("sounds/tank_fire_short.mp3", Sound.class);
manager.load("sounds/explosion.mp3", Sound.class);
@@ -79,10 +81,12 @@ public class TankOnTank extends Game
manager.unload("data/unit-overlays.atlas");
manager.unload("data/hex-overlays.atlas");
manager.unload("data/dice.png");
+ manager.unload("data/infantry_fire.png");
manager.unload("data/tank_fire.png");
manager.unload("data/explosions.png");
manager.unload("sounds/dice.mp3");
manager.unload("sounds/move.mp3");
+ manager.unload("sounds/infantry_fire.mp3");
manager.unload("sounds/tank_fire.mp3");
manager.unload("sounds/tank_fire_short.mp3");
manager.unload("sounds/explosion.mp3");
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)
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index ff418a0..d7f5e92 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -95,8 +95,10 @@ public abstract class Map extends Board
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));
FireAnimation.init(
- game.manager.get("data/tank_fire.png", Texture.class), 1, 7,
+ game.manager.get("data/infantry_fire.png", Texture.class), 1, 8,
+ game.manager.get("data/tank_fire.png", Texture.class), 1, 8,
game.manager.get("data/explosions.png", Texture.class), 16, 8,
+ game.manager.get("sounds/infantry_fire.mp3", Sound.class),
game.manager.get("sounds/tank_fire.mp3", Sound.class),
game.manager.get("sounds/tank_fire_short.mp3", Sound.class),
game.manager.get("sounds/explosion.mp3", Sound.class),