diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-11-20 05:57:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-11-20 05:57:13 +0100 |
commit | 8d9fc76d27b219a989df0e948d1c7c8eeaa0a27d (patch) | |
tree | 82f3d45c4b123681892b576348f27dec28384e82 /test/src/ch | |
parent | ea06841f1bfff624f6e5f1266c7398292664d3e3 (diff) | |
download | gdx-boardgame-8d9fc76d27b219a989df0e948d1c7c8eeaa0a27d.zip gdx-boardgame-8d9fc76d27b219a989df0e948d1c7c8eeaa0a27d.tar.gz |
AnimationsScreen : demo ShellFireAnimation
Diffstat (limited to 'test/src/ch')
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java index 20599ed..3f7d531 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java @@ -20,6 +20,7 @@ import ch.asynk.gdx.boardgame.animations.BounceAnimation; import ch.asynk.gdx.boardgame.animations.DelayAnimation; import ch.asynk.gdx.boardgame.animations.FadeAnimation; import ch.asynk.gdx.boardgame.animations.MoveAnimation; +import ch.asynk.gdx.boardgame.animations.ShellFireAnimation; public class AnimationsScreen extends AbstractScreen { @@ -52,6 +53,9 @@ public class AnimationsScreen extends AbstractScreen path = buildPath(app); AnimationBatch batch; + ShellFireAnimation.register("tankShell", 1f, 66f, 400f, 1.3f, 1f, + app.assets.getTexture(app.assets.SHELL_FIRE), 1, 8, + app.assets.getTexture(app.assets.EXPLOSIONS), 16, 8); animations = AnimationSequence.obtain(10); animations.add(BounceAnimation.obtain(panzer, 2f, 3f, -1)); @@ -67,6 +71,7 @@ public class AnimationsScreen extends AbstractScreen batch.add(FadeAnimation.obtain(other0, 0f, 1f, 1f)); batch.add(FadeAnimation.obtain(other1, 0f, 1f, 1f)); animations.add(batch); + animations.add(getFireAnimationBatch()); animations.add(DelayAnimation.obtain(1f)); batch = AnimationBatch.obtain(2); batch.add(FadeAnimation.obtain(other0, 1f, 0f, 1f)); @@ -114,8 +119,17 @@ public class AnimationsScreen extends AbstractScreen return path; } + private AnimationBatch getFireAnimationBatch() + { + AnimationBatch batch = AnimationBatch.obtain(2); + batch.add(ShellFireAnimation.obtain("tankShell", other0, panzer)); + batch.add(ShellFireAnimation.obtain("tankShell", other1, panzer)); + return batch; + } + @Override public void dispose() { + ShellFireAnimation.free(); animations.dispose(); super.dispose(); } |