diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-18 11:08:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-18 11:08:16 +0200 |
commit | 457a018f06b2aa7ea84429e83a414b81ed848a1f (patch) | |
tree | 4faf1f3aaf7455320d388e9cac31f293a6162bd0 /core/src/ch/asynk | |
parent | 9ea06ab37a515cd413974077a6c7c3c71590edb5 (diff) | |
download | gdx-boardgame-457a018f06b2aa7ea84429e83a414b81ed848a1f.zip gdx-boardgame-457a018f06b2aa7ea84429e83a414b81ed848a1f.tar.gz |
MoveAnimation : code simplification
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java index 45b355e..e47eb3a 100644 --- a/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java +++ b/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java @@ -104,10 +104,8 @@ public class MoveAnimation implements Animation, Pool.Poolable piece.rotate(dt.z * delta); percent += (dp * delta); - if (notify && percent >= 0.5) { - if (cb != null) { - cb.onTileChange(piece, path); - } + if (notify && cb != null && percent >= 0.5f) { + cb.onTileChange(piece, path); notify = false; } if (percent >= 1f) { |