diff --git a/flixel/animation/FlxAnimation.hx b/flixel/animation/FlxAnimation.hx index a3a4d7e723..2039bb9758 100644 --- a/flixel/animation/FlxAnimation.hx +++ b/flixel/animation/FlxAnimation.hx @@ -43,6 +43,12 @@ class FlxAnimation extends FlxBaseAnimation */ public var looped(default, null):Bool = true; + /** + * The custom loop point for this animation. + * This allows you to skip the first few frames of an animation when looping. + */ + public var loopPoint:Int = 0; + /** * Whether or not this animation is being played backwards. */ @@ -191,7 +197,7 @@ class FlxAnimation extends FlxBaseAnimation _frameTimer -= delay; if (reversed) { - if (looped && curFrame == 0) + if (looped && curFrame == loopPoint) curFrame = numFrames - 1; else curFrame--; @@ -199,7 +205,7 @@ class FlxAnimation extends FlxBaseAnimation else { if (looped && curFrame == numFrames - 1) - curFrame = 0; + curFrame = loopPoint; else curFrame++; }