Function change

  • change the game/app state

    Parameters

    • state: number

      State ID (see constants)

    • OptionalforceChange: boolean = false

      if true the state will be changed immediately (without waiting for the next frame)

    • Rest...args: any

      extra arguments to be passed to the reset functions

    Returns void

    change

    state

    // The onResetEvent method on the play screen will receive two args:
    // "level_1" and the number 3
    me.state.change(me.state.PLAY, "level_1", 3);