timer.after

Section: Timer

What it does

timer.after takes seconds and a function.

The API says: returns cancel fn

Signature

timer.after(seconds, () => {...})

Arguments

  • seconds
  • () => {...}

Example · generated

function start() {  timer.after(1, () => {});}

timer.after is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.

2 members in timer