Tween hasStarted parameter set to false when tween finishes

This commit is contained in:
Javier Alcantara 2015-11-11 18:39:05 +01:00
parent 1c169ef571
commit 840b49b6cd

View file

@ -138,13 +138,13 @@ Phaser.Tween = function (target, game, manager) {
* Is this Tween frame or time based? A frame based tween will use the physics elapsed timer when updating. This means * Is this Tween frame or time based? A frame based tween will use the physics elapsed timer when updating. This means
* it will retain the same consistent frame rate, regardless of the speed of the device. The duration value given should * it will retain the same consistent frame rate, regardless of the speed of the device. The duration value given should
* be given in frames. * be given in frames.
* *
* If the Tween uses a time based update (which is the default) then the duration is given in milliseconds. * If the Tween uses a time based update (which is the default) then the duration is given in milliseconds.
* In this situation a 2000ms tween will last exactly 2 seconds, regardless of the device and how many visual updates the tween * In this situation a 2000ms tween will last exactly 2 seconds, regardless of the device and how many visual updates the tween
* has actually been through. For very short tweens you may wish to experiment with a frame based update instead. * has actually been through. For very short tweens you may wish to experiment with a frame based update instead.
* *
* The default value is whatever you've set in TweenManager.frameBased. * The default value is whatever you've set in TweenManager.frameBased.
* *
* @property {boolean} frameBased * @property {boolean} frameBased
* @default * @default
*/ */
@ -357,6 +357,7 @@ Phaser.Tween.prototype = {
if (complete) if (complete)
{ {
this.onComplete.dispatch(this.target, this); this.onComplete.dispatch(this.target, this);
this._hasStarted = false;
if (this.chainedTween) if (this.chainedTween)
{ {
@ -813,6 +814,7 @@ Phaser.Tween.prototype = {
// No more repeats and no more children, so we're done // No more repeats and no more children, so we're done
this.isRunning = false; this.isRunning = false;
this.onComplete.dispatch(this.target, this); this.onComplete.dispatch(this.target, this);
this._hasStarted = false;
if (this.chainedTween) if (this.chainedTween)
{ {