OSDN Git Service

Modified isAnimationFinished when looping
authorGuillermo Andrades <guillermo.andrades@cremagames.com>
Thu, 10 Jan 2013 09:48:43 +0000 (10:48 +0100)
committerGuillermo Andrades <guillermo.andrades@cremagames.com>
Thu, 10 Jan 2013 09:48:43 +0000 (10:48 +0100)
Always return false if the current animation is looping

gdx/src/com/badlogic/gdx/graphics/g2d/Animation.java

index ac28d8b..846c5a1 100644 (file)
@@ -167,6 +167,7 @@ public class Animation {
         * @param stateTime\r
         * @return whether the animation is finished. */\r
        public boolean isAnimationFinished (float stateTime) {\r
+               if(playMode != NORMAL && playMode != REVERSED) return false;\r
                int frameNumber = (int)(stateTime / frameDuration);\r
                return keyFrames.length - 1 < frameNumber;\r
        }\r