Options
All
  • Public
  • Public/Protected
  • All
Menu

Class State

The State class is used to store data that can be accessed throughout your game.
For example, you can use it from a game object to update a state value, then access this state value from the game's update method or from another game object.
Think of it as a big container available from anywhere you import it.

Hierarchy

  • State

Index

Methods

Methods

Static _init

  • _init(): void
  • Used internally to initialise the State class.

    Returns void

Static get

  • get(key: string): any
  • Get a state value.

    Parameters

    • key: string

      The name of the state.

    Returns any

    The value of the state, null if the state was not set.

Static set

  • set(key: string, value: any): void
  • Set (create or update) a state value.

    Parameters

    • key: string

      The name of the state.

    • value: any

      The value of the state.

    Returns void

Generated using TypeDoc