Skip to content

Commit a1bb809

Browse files
committed
fixed play in yoyo mode, bug found by @Ben-Millions phaserjs#3837
1 parent 0a4fc5b commit a1bb809

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/animations/Animation.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,12 @@ var Animation = new Class({
583583
// Yoyo? (happens before repeat)
584584
if (component._yoyo)
585585
{
586+
if (component._reverse !== false)
587+
{
588+
this.completeAnimation(component);
589+
return;
590+
}
591+
586592
component.forward = false;
587593
this._updateAndGetNextTick(component, frame.prevFrame);
588594
}
@@ -643,6 +649,12 @@ var Animation = new Class({
643649

644650
if (component._yoyo)
645651
{
652+
if (component._reverse !== true)
653+
{
654+
this.completeAnimation(component);
655+
return;
656+
}
657+
646658
component.forward = true;
647659
this._updateAndGetNextTick(component, frame.nextFrame);
648660
}

0 commit comments

Comments
 (0)