timer(maxLoopsPerFrame?: number): TimerComp

Enable timer related functions like wait(), loop(), tween() on the game object.

parammaxLoopsPerFrame- The maximum number of loops per frame.

const obj = add([
    timer(),
])

obj.wait(2, () => { ... })
obj.loop(0.5, () => { ... })
obj.tween(obj.pos, mousePos(), 0.5, (p) => obj.pos = p, easings.easeOutElastic)

returnsThe timer comp.

sincev2000.0