MCPcopy Create free account
hub / github.com/melonjs/melonJS / update

Method update

packages/melonjs/src/physics/world.js:320–334  ·  view source on GitHub ↗

* update the game world * @param {number} dt - the time passed since the last frame update * @returns {boolean} true if the world is dirty

(dt)

Source from the content-addressed store, hash-verified

318 * @returns {boolean} true if the world is dirty
319 */
320 update(dt) {
321 // only update the quadtree if necessary
322 if (this.physic === "builtin" || hasRegisteredEvents() === true) {
323 // clear the quadtree
324 this.broadphase.clear();
325 // insert the world container (children) into the quadtree
326 this.broadphase.insertContainer(this);
327 }
328
329 // advance the active adapter's simulation
330 this.step(dt);
331
332 // call the super constructor
333 return super.update(dt);
334 }
335
336 /**
337 * update the physics simulation by one step (called by the game world update method)

Callers

nothing calls this directly

Calls 4

stepMethod · 0.95
hasRegisteredEventsFunction · 0.90
clearMethod · 0.65
insertContainerMethod · 0.65

Tested by

no test coverage detected