mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Animation: Fixes an issue where setFrame would skip a frame if the animation was currently playing backwards
This commit is contained in:
parent
6a81bcb590
commit
86739184bb
1 changed files with 3 additions and 2 deletions
|
@ -320,8 +320,9 @@ Phaser.Animation.prototype = {
|
||||||
|
|
||||||
if (frameIndex)
|
if (frameIndex)
|
||||||
{
|
{
|
||||||
// Set the current frame index to the found index. Subtract 1 so that it animates to the desired frame on update.
|
// Set the current frame index to the found index. Subtract a directional offset so that it animates to the desired frame on update.
|
||||||
this._frameIndex = frameIndex - 1;
|
var directionalOffset = this.isReversed ? -1 : 1;
|
||||||
|
this._frameIndex = frameIndex - directionalOffset;
|
||||||
|
|
||||||
// Make the animation update at next update
|
// Make the animation update at next update
|
||||||
this._timeNextFrame = this.game.time.time;
|
this._timeNextFrame = this.game.time.time;
|
||||||
|
|
Loading…
Reference in a new issue