@@ -583,7 +583,7 @@ var Animation = new Class({
583583 // Yoyo? (happens before repeat)
584584 if ( component . _yoyo )
585585 {
586- this . _handleYoyoFrame ( component , false ) ;
586+ this . handleYoyoFrame ( component , false ) ;
587587 }
588588 else if ( component . repeatCounter > 0 )
589589 {
@@ -605,39 +605,45 @@ var Animation = new Class({
605605 }
606606 else
607607 {
608- this . _updateAndGetNextTick ( component , frame . nextFrame ) ;
608+ this . updateAndGetNextTick ( component , frame . nextFrame ) ;
609609 }
610610 } ,
611611
612612 /**
613613 * Handle the yoyo functionality in nextFrame and previousFrame methods.
614614 *
615- * @method Phaser.Animations.Animation#_handleYoyoFrame
615+ * @method Phaser.Animations.Animation#handleYoyoFrame
616+ * @private
616617 * @since 3.12.0
617618 *
618619 * @param {Phaser.GameObjects.Components.Animation } component - The Animation Component to advance.
619- * @param {bool } isReverse - Is animation in reverse mode? (Default: false)
620+ * @param {boolean } isReverse - Is animation in reverse mode? (Default: false)
620621 */
621- _handleYoyoFrame : function ( component , isReverse )
622+ handleYoyoFrame : function ( component , isReverse )
622623 {
623624 if ( ! isReverse ) { isReverse = false ; }
624625
625626 if ( component . _reverse === ! isReverse && component . repeatCounter > 0 )
626627 {
627628 component . forward = isReverse ;
629+
628630 this . repeatAnimation ( component ) ;
631+
629632 return ;
630633 }
631634
632635 if ( component . _reverse !== isReverse && component . repeatCounter === 0 )
633636 {
634637 this . completeAnimation ( component ) ;
638+
635639 return ;
636640 }
637641
638642 component . forward = isReverse ;
639- var frame = isReverse ? component . currentFrame . nextFrame : component . currentFrame . prevFrame ;
640- this . _updateAndGetNextTick ( component , frame ) ;
643+
644+ var frame = ( isReverse ) ? component . currentFrame . nextFrame : component . currentFrame . prevFrame ;
645+
646+ this . updateAndGetNextTick ( component , frame ) ;
641647 } ,
642648
643649 /**
@@ -673,7 +679,7 @@ var Animation = new Class({
673679
674680 if ( component . _yoyo )
675681 {
676- this . _handleYoyoFrame ( component , true ) ;
682+ this . handleYoyoFrame ( component , true ) ;
677683 }
678684 else if ( component . repeatCounter > 0 )
679685 {
@@ -696,22 +702,23 @@ var Animation = new Class({
696702 }
697703 else
698704 {
699- this . _updateAndGetNextTick ( component , frame . prevFrame ) ;
705+ this . updateAndGetNextTick ( component , frame . prevFrame ) ;
700706 }
701707 } ,
702708
703709 /**
704- * Update Frame and Wait next tick
710+ * Update Frame and Wait next tick.
705711 *
706- * @method Phaser.Animations.Animation#_updateAndGetNextTick
712+ * @method Phaser.Animations.Animation#updateAndGetNextTick
713+ * @private
707714 * @since 3.12.0
708715 *
709- * @param {Phaser.Animations.AnimationFrame } frame - An Animation frame
710- *
716+ * @param {Phaser.Animations.AnimationFrame } frame - An Animation frame.
711717 */
712- _updateAndGetNextTick : function ( component , frame )
718+ updateAndGetNextTick : function ( component , frame )
713719 {
714720 component . updateFrame ( frame ) ;
721+
715722 this . getNextTick ( component ) ;
716723 } ,
717724
0 commit comments