File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
252252 // Only apply lifespan decrement in the first updateLogic pass.
253253 if ( this . lifespan > 0 && this . game . updateNumber === 0 )
254254 {
255- this . lifespan -= this . game . time . elapsedMS ;
255+ this . lifespan -= this . game . time . physicsElapsedMS ;
256256
257257 if ( this . lifespan <= 0 )
258258 {
Original file line number Diff line number Diff line change @@ -86,6 +86,13 @@ Phaser.Time = function (game) {
8686 */
8787 this . physicsElapsed = 0 ;
8888
89+ /**
90+ * The Time.physicsElapsed property * 1000.
91+ *
92+ * @property {number } physicsElapsedMS
93+ */
94+ this . physicsElapsedMS = 0 ;
95+
8996 /**
9097 * The desired frame rate of the game.
9198 *
@@ -355,6 +362,8 @@ Phaser.Time.prototype = {
355362 // Set the physics elapsed time... this will always be 1 / this.desiredFps because we're using fixed time steps in game.update now
356363 this . physicsElapsed = 1 / this . desiredFps ;
357364
365+ this . physicsElapsedMS = this . physicsElapsed * 1000 ;
366+
358367 if ( this . advancedTiming )
359368 {
360369 this . msMin = Math . min ( this . msMin , this . elapsed ) ;
Original file line number Diff line number Diff line change @@ -332,12 +332,12 @@ Phaser.TweenData.prototype = {
332332
333333 if ( this . parent . reverse )
334334 {
335- this . dt -= ( this . game . time . physicsElapsed * 1000 ) * this . parent . timeScale ;
335+ this . dt -= this . game . time . physicsElapsedMS * this . parent . timeScale ;
336336 this . dt = Math . max ( this . dt , 0 ) ;
337337 }
338338 else
339339 {
340- this . dt += ( this . game . time . physicsElapsed * 1000 ) * this . parent . timeScale ;
340+ this . dt += this . game . time . physicsElapsedMS * this . parent . timeScale ;
341341 this . dt = Math . min ( this . dt , this . duration ) ;
342342 }
343343
You can’t perform that action at this time.
0 commit comments