melonjs
    Preparing search index...

    Function change

    • change the game/app state

      Parameters

      • state: number

        State ID (see constants)

      • OptionalforceChange: boolean

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

      • ...args: any[] = false

        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);