Physics integration and a fix to Tween that stopped the repeat/yoyo from working.

This commit is contained in:
Richard Davey
2013-09-03 17:07:05 +01:00
parent bdc1c2ceb9
commit 2fe8a3a0a7
9 changed files with 330 additions and 90 deletions
+11 -10
View File
@@ -62,21 +62,24 @@ Phaser.Tween.prototype = {
*/
to: function ( properties, duration, ease, autoStart, delay, repeat, yoyo ) {
if (typeof duration === "undefined") { duration = 1000; }
if (typeof ease === "undefined") { ease = null; }
if (typeof autoStart === "undefined") { autoStart = false; }
if (typeof delay === "undefined") { delay = 0; }
if (typeof repeat === "undefined") { repeat = 0; }
if (typeof yoyo === "undefined") { yoyo = false; }
duration = duration || 1000;
ease = ease || null;
autoStart = autoStart || false;
delay = delay || 0;
repeat = repeat || 0;
yoyo = yoyo || false;
this._repeat = repeat;
this._duration = duration;
this._valuesEnd = properties;
if (ease !== null) {
if (ease !== null)
{
this._easingFunction = ease;
}
if (delay > 0) {
if (delay > 0)
{
this._delayTime = delay;
}
@@ -104,8 +107,6 @@ Phaser.Tween.prototype = {
this._onStartCallbackFired = false;
// this._startTime = time !== undefined ? time : ( typeof window !== 'undefined' && window.performance !== undefined && window.performance.now !== undefined ? window.performance.now() : Date.now() );
// this._startTime += _delayTime;
this._startTime = this.game.time.now + this._delayTime;
for ( var property in this._valuesEnd ) {