Core loop of a FUDGE application. Initializes automatically and must be started explicitly. It then fires EVENT.LOOP_FRAME to all added listeners at each frame

Author

Jirka Dell'Oro-Friedl, HFU, 2019

Hierarchy (view full)

Accessors

  • get timeStartGame(): number
  • The gametime the loop was started, overwritten at each start

    Returns number

  • get timeStartReal(): number
  • The realtime the loop was started, overwritten at each start

    Returns number

Methods

  • Starts the loop with the given mode and fps.
    The default for _mode is FRAME_REQUEST, see LOOP_MODE, hooking the loop to the browser's animation frame. Is only applicable in TIME-modes. _syncWithAnimationFrame is experimental and only applicable in TIME-modes, deferring the loop-cycle until the next possible animation frame.

    Parameters

    • _mode: LOOP_MODE = LOOP_MODE.FRAME_REQUEST
    • _fps: number = 60
    • _syncWithAnimationFrame: boolean = false

    Returns void