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

Method onCollisionStart

packages/melonjs/src/renderable/trigger.js:240–244  ·  view source on GitHub ↗

* Fire the trigger when an entity first enters the trigger zone. * Using `onCollisionStart` rather than `onCollision` so the event * runs exactly once per entry — under the legacy alias this would * fire every frame the entity was inside the trigger.

()

Source from the content-addressed store, hash-verified

238 * fire every frame the entity was inside the trigger.
239 */
240 onCollisionStart() {
241 if (this.name === "Trigger") {
242 this.triggerEvent();
243 }
244 }
245}

Callers 2

collisionsMethod · 0.45
trigger.spec.jsFile · 0.45

Calls 1

triggerEventMethod · 0.95

Tested by

no test coverage detected