If Tween.yoyo was true but repeat was 0 then it wouldn't yoyo. Now if yoyo is set, but not repeat, the repeat count gets set to 1 (thanks @hilts-vaughan, fix #744)

This commit is contained in:
photonstorm 2014-04-22 02:12:21 +01:00
parent 6ace9e6031
commit e4887c8177
3 changed files with 15 additions and 3 deletions

View file

@ -74,6 +74,7 @@ Version 2.0.4 - "Mos Shirare" - in development
* The Emitter no longer checks if minParticleScale = maxParticleScale for the scale check, allowing for fixed scale particles again.
* The PIXI.AbstractFilter is now included in the Phaser Pixi build by default, allowing for easier use of external Pixi Filters.
* All Game Objects have a new property: destroyPhase (boolean) which is true if the object is in the process of being destroyed, otherwise false.
* If Tween.yoyo was true but repeat was 0 then it wouldn't yoyo. Now if yoyo is set, but not repeat, the repeat count gets set to 1 (thanks @hilts-vaughan, fix #744)
### New Features

4
build/phaser.d.ts vendored
View file

@ -3434,8 +3434,8 @@ declare module Phaser {
multiply(x: number, y: number): Phaser.Point;
normalise(): Phaser.Point;
rotate(x: number, y: number, angle: number, asDegrees: boolean, distance?: number): Phaser.Point;
set(x: number, y: number): Phaser.Point;
setTo(x: number, y: number): Phaser.Point;
set(x: number, y?: number): Phaser.Point;
setTo(x: number, y?: number): Phaser.Point;
subtract(x: number, y: number): Phaser.Point;
toString(): string;

View file

@ -212,6 +212,11 @@ Phaser.Tween.prototype = {
repeat = repeat || 0;
yoyo = yoyo || false;
if (yoyo && repeat === 0)
{
repeat = 1;
}
var self;
if (this._parent)
@ -456,6 +461,7 @@ Phaser.Tween.prototype = {
repeat: function (times) {
this._repeat = times;
return this;
},
@ -471,6 +477,12 @@ Phaser.Tween.prototype = {
yoyo: function(yoyo) {
this._yoyo = yoyo;
if (yoyo && this._repeat === 0)
{
this._repeat = 1;
}
return this;
},
@ -717,7 +729,6 @@ Phaser.Tween.prototype = {
this.onLoop.dispatch(this._object);
return true;
}
else
{