From 5591bf3f826eff842e019bc82db5ae53aacba416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 22 Nov 2018 16:18:22 +0100 Subject: AnimationScreen : test sounds in ShellFireAnimation --- assets/data/explosion.ogg | Bin 0 -> 66919 bytes assets/data/shell_fire.ogg | Bin 0 -> 56019 bytes .../ch/asynk/gdx/boardgame/test/AnimationsScreen.java | 8 ++++++-- test/src/ch/asynk/gdx/boardgame/test/Assets.java | 7 +++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 assets/data/explosion.ogg create mode 100644 assets/data/shell_fire.ogg diff --git a/assets/data/explosion.ogg b/assets/data/explosion.ogg new file mode 100644 index 0000000..a738f3e Binary files /dev/null and b/assets/data/explosion.ogg differ diff --git a/assets/data/shell_fire.ogg b/assets/data/shell_fire.ogg new file mode 100644 index 0000000..77078d4 Binary files /dev/null and b/assets/data/shell_fire.ogg differ diff --git a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java index 6fff822..27295e6 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java @@ -55,10 +55,14 @@ public class AnimationsScreen extends AbstractScreen AnimationBatch batch; ShellFireAnimation.register("cfg0", 1f, 66f, 400f, 1.3f, 1f, app.assets.getTexture(app.assets.SHELL_FIRE), 1, 8, - app.assets.getTexture(app.assets.EXPLOSIONS), 16, 8); + app.assets.getTexture(app.assets.EXPLOSIONS), 16, 8, + app.assets.getSound(app.assets.SHELL_FIRE_SND), + app.assets.getSound(app.assets.EXPLOSION_SND)); ShellFireAnimation.register("cfg1", .5f, 11f, 500f, .8f, 1f, app.assets.getTexture(app.assets.SHELL_FIRE), 1, 8, - app.assets.getTexture(app.assets.EXPLOSIONS), 16, 8); + app.assets.getTexture(app.assets.EXPLOSIONS), 16, 8, + app.assets.getSound(app.assets.SHELL_FIRE_SND), + app.assets.getSound(app.assets.EXPLOSION_SND)); animations = AnimationSequence.obtain(10); animations.add(BounceAnimation.obtain(panzer, 2f, 3f, -1)); diff --git a/test/src/ch/asynk/gdx/boardgame/test/Assets.java b/test/src/ch/asynk/gdx/boardgame/test/Assets.java index d7e9a1b..e1b4023 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/Assets.java +++ b/test/src/ch/asynk/gdx/boardgame/test/Assets.java @@ -1,5 +1,6 @@ package ch.asynk.gdx.boardgame.test; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.assets.loaders.FileHandleResolver; import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; import com.badlogic.gdx.graphics.Texture; @@ -25,7 +26,9 @@ public class Assets extends ch.asynk.gdx.boardgame.Assets public static final String PANZER = "panzer.png"; public static final String HEX_OVERLAYS = "hex-overlays.atlas"; public static final String SHELL_FIRE = "shell_fire.png"; + public static final String SHELL_FIRE_SND = "shell_fire.ogg"; public static final String EXPLOSIONS = "explosions.png"; + public static final String EXPLOSION_SND = "explosion.ogg"; private final FreeTypeFontLoaderParameter params20; private final FreeTypeFontLoaderParameter params25; @@ -73,7 +76,9 @@ public class Assets extends ch.asynk.gdx.boardgame.Assets load(FONT_25, BitmapFont.class, params25); load(HEX_OVERLAYS, TextureAtlas.class); load(SHELL_FIRE, Texture.class); + load(SHELL_FIRE_SND, Sound.class); load(EXPLOSIONS, Texture.class); + load(EXPLOSION_SND, Sound.class); } public void unloadApp() @@ -88,6 +93,8 @@ public class Assets extends ch.asynk.gdx.boardgame.Assets unload(FONT_25); unload(HEX_OVERLAYS); unload(SHELL_FIRE); + unload(SHELL_FIRE_SND); unload(EXPLOSIONS); + unload(EXPLOSION_SND); } } -- cgit v1.1-2-g2b99