Add delta arg to WORLD_STEP event

This commit is contained in:
samme 2020-09-01 11:33:31 -07:00
parent 8f48d39934
commit e194e9586f
2 changed files with 7 additions and 5 deletions

View file

@ -983,7 +983,7 @@ var World = new Class({
} }
} }
this.emit(Events.WORLD_STEP); this.emit(Events.WORLD_STEP, fixedDelta);
} }
// Process any additional steps this frame // Process any additional steps this frame
@ -1042,7 +1042,7 @@ var World = new Class({
} }
} }
this.emit(Events.WORLD_STEP); this.emit(Events.WORLD_STEP, delta);
this.stepsLastFrame++; this.stepsLastFrame++;
}, },

View file

@ -6,15 +6,17 @@
/** /**
* The Arcade Physics World Step Event. * The Arcade Physics World Step Event.
* *
* This event is dispatched by an Arcade Physics World instance whenever a physics step is run. * This event is dispatched by an Arcade Physics World instance whenever a physics step is run.
* It is emitted _after_ the bodies and colliders have been updated. * It is emitted _after_ the bodies and colliders have been updated.
* *
* In high framerate settings this can be multiple times per game frame. * In high framerate settings this can be multiple times per game frame.
* *
* Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`.
* *
* @event Phaser.Physics.Arcade.Events#WORLD_STEP * @event Phaser.Physics.Arcade.Events#WORLD_STEP
* @since 3.18.0 * @since 3.18.0
*
* @param {number} delta - The delta time amount of this step, in seconds.
*/ */
module.exports = 'worldstep'; module.exports = 'worldstep';