A Number that specifies the time step between updates in milliseconds.
If engine.timing.isFixed is set to true, then delta is fixed.
If it is false, then delta can dynamically change to maintain the correct apparent simulation speed.
A flag that specifies whether the runner is running or not.
A Boolean that specifies if the runner should use a fixed timestep (otherwise it is variable).
If timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic).
If the timing is variable, then the apparent simulation speed will be constant (approximately, but at the cost of determininism).
StaticcreateCreates a new Runner. The options parameter is an object that specifies any properties you wish to override the defaults.
StaticrunStaticstartStaticstopStatictickA game loop utility that updates the engine and renderer by one step (a 'tick').
Features delta smoothing, time correction and fixed or dynamic timing.
Triggers beforeTick, tick and afterTick events on the engine.
Consider just Engine.update(engine, delta) if you're using your own loop.
The
Matter.Runnermodule is an optional utility which provides a game loop, that handles updating and rendering aMatter.Enginefor you within a browser. It is intended for demo and testing purposes, but may be adequate for simple games. If you are using your own game loop instead, then you do not need theMatter.Runnermodule. Instead just callEngine.update(engine, delta)in your own loop. Note that the methodEngine.runis an alias forRunner.run.See the included usage examples.
Runner