Skip to content

Commit d786d4e

Browse files
committed
Merge pull request phaserjs#1317 from pjbaron/dev
prevent multiple catch-up frames which cause physics objects to 'tunnel'
2 parents 26e74fe + 7bd0a8d commit d786d4e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/Game.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,8 @@ Phaser.Game.prototype = {
727727
// step size taking into account the slow motion speed
728728
var slowStep = this.time.slowMotion * 1000.0 / this.time.desiredFps;
729729

730-
// accumulate time until the slowStep threshold is met or exceeded
731-
this._deltaTime += Math.max(Math.min(1000, this.time.elapsed), 0);
730+
// accumulate time until the slowStep threshold is met or exceeded... up to a limit of 3 catch-up frames at slowStep intervals
731+
this._deltaTime += Math.max(Math.min(slowStep * 3, this.time.elapsed), 0);
732732

733733
// call the game update logic multiple times if necessary to "catch up" with dropped frames
734734
// unless forceSingleUpdate is true

0 commit comments

Comments
 (0)