game.getCollisions

Section: Game / Entities

What it does

game.getCollisions reads Collisions on a game object. It takes no arguments.

The API says: array of colliding ids

Signature

game.getCollisions()

Arguments

It takes none.

Example · generated

function update(dt) {  const collisions = game.getCollisions();}

game.getCollisions is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

12 members in game