Skip to content

Commit 152b26a

Browse files
committed
Merge pull request phaserjs#1378 from pnstickne/wip-minor-updatelogic-fix
Minor logic fix for Sprite life update
2 parents 81f356c + 3299588 commit 152b26a

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/core/Game.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
292292
this._codePaused = false;
293293

294294
/**
295-
* The number of the logic update applied this render frame, starting from 0.
295+
* The ID of the current/last logic update applied this render frame, starting from 0.
296296
*
297-
* The first update is `updateNumber === 0` and the last update is `updateNumber === updatesThisFrame.`
298-
* @property {number} updateNumber
297+
* The first update is `currentUpdateID === 0` and the last update is `currentUpdateID === updatesThisFrame.`
298+
* @property {integer} currentUpdateID
299299
* @protected
300300
*/
301-
this.updateNumber = 0;
301+
this.currentUpdateID = 0;
302302

303303
/**
304304
* Number of logic updates expected to occur this render frame;
@@ -738,7 +738,7 @@ Phaser.Game.prototype = {
738738
while (this._deltaTime >= slowStep)
739739
{
740740
this._deltaTime -= slowStep;
741-
this.updateNumber = count;
741+
this.currentUpdateID = count;
742742
this.updateLogic(1.0 / this.time.desiredFps);
743743
count++;
744744

src/gameobjects/Sprite.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
249249
return false;
250250
}
251251

252-
// Only apply lifespan decrement in the first updateLogic pass.
253-
if (this.lifespan > 0 && this.game.updateNumber === 0)
252+
if (this.lifespan > 0)
254253
{
255254
this.lifespan -= this.game.time.physicsElapsedMS;
256255

0 commit comments

Comments
 (0)