Helps instruct when to tick. Times are based on performance.now()

Hierarchy

  • TickHelper

Constructors

Properties

lastTickTime: undefined | number

Time the last tick occurred

nextTickTime: undefined | number

Time the next tick should run

Accessors

  • get hasScheduledTick(): boolean
  • Check if a tick is scheduled

    Returns boolean

Methods

  • Checks if the amount of time has passed since the previous tick

    Parameters

    • delay: number

      Delay

    • timeStamp: number = ...

      Timestamp or undefined if it's not available from the caller

    Returns boolean

  • Mark that we ticked

    Parameters

    • timeStamp: number = ...

    Returns void

  • Resets internal data

    Returns void

  • Schedules a tick

    Parameters

    • tickSpeed: number = ...

      Game tick speed

    • timeStamp: number = ...

      Timestamp or undefined if it's not available from the caller

    • Optional minTime: number

      Minimum amount of time until the next time should run

    Returns void

  • Check if we should tick based on the provided timestamp.

    Parameters

    • timeStamp: number = ...

    Returns boolean

  • Clears any pending scheduled tick

    Returns void

Generated using TypeDoc