CTFTNKS Project Documentation - v1.3.0
    Preparing search index...

    Class GameTimeout

    A timeout that executes a callback after a specific game time delay.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new GameTimeout.

      Parameters

      • delay: number

        the time duration [ms] after which the callback should be run.

      • callback: () => void

        The callback to execute.

      • OptionalisInterval: boolean

        should the timeout restart after it is finished (i.e. should it run periodically?).

      Returns GameTimeout

    Properties

    age: number = 0

    time (in milliseconds) for how long the object already exists in the game

    maxAge?: number

    optional duration in milliseconds for how long the object should still exist in the game

    Methods

    • Check if the timeout exceeds its finish time and if so, call the callback

      Parameters

      • _dt: number

      Returns void