mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
When playing an animation in reverse, if it reached the first frame and had to repeat, it would then jump to the frame before the final frame and carry on, skipping out the final frame.
This commit is contained in:
parent
cebd1d0101
commit
66f4ab69e7
1 changed files with 10 additions and 7 deletions
|
@ -197,8 +197,11 @@ var Animation = new Class({
|
|||
|
||||
this.calculateDuration(this, this.getTotalFrames(), this.duration, this.frameRate);
|
||||
|
||||
this.manager.on(Events.PAUSE_ALL, this.pause, this);
|
||||
this.manager.on(Events.RESUME_ALL, this.resume, this);
|
||||
if (this.manager.on)
|
||||
{
|
||||
this.manager.on(Events.PAUSE_ALL, this.pause, this);
|
||||
this.manager.on(Events.RESUME_ALL, this.resume, this);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -619,7 +622,6 @@ var Animation = new Class({
|
|||
if (frame.isFirst)
|
||||
{
|
||||
// We're at the start of the animation
|
||||
|
||||
if (component.yoyo)
|
||||
{
|
||||
this.handleYoyoFrame(component, true);
|
||||
|
@ -628,8 +630,6 @@ var Animation = new Class({
|
|||
{
|
||||
if (component.inReverse && !component.forward)
|
||||
{
|
||||
component.currentFrame = this.getLastFrame();
|
||||
|
||||
this.repeatAnimation(component);
|
||||
}
|
||||
else
|
||||
|
@ -896,8 +896,11 @@ var Animation = new Class({
|
|||
{
|
||||
this.removeAllListeners();
|
||||
|
||||
this.manager.off(Events.PAUSE_ALL, this.pause, this);
|
||||
this.manager.off(Events.RESUME_ALL, this.resume, this);
|
||||
if (this.manager.off)
|
||||
{
|
||||
this.manager.off(Events.PAUSE_ALL, this.pause, this);
|
||||
this.manager.off(Events.RESUME_ALL, this.resume, this);
|
||||
}
|
||||
|
||||
this.manager.remove(this.key);
|
||||
|
||||
|
|
Loading…
Reference in a new issue