Skip to main content

coroutine

Callable


  • Excalibur coroutine helper, returns a [[CoroutineInstance]] which is promise-like when complete. Coroutines run before frame update by default.

    Each coroutine yield is 1 excalibur frame. Coroutines get passed the elapsed time out of yield. Coroutines run internally on the excalibur clock.

    If you yield a promise it will be awaited before resumed (the yield expression still evaluates to the resumed frame's elapsed ms, not the promise's resolved value) If you yield a number it will wait at least that many ms before resumed (the yield expression evaluates to the resumed frame's elapsed ms)


    Parameters

    Returns CoroutineInstance