summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-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
3 files changed, 21 insertions, 1 deletions
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),