melonJS
    Preparing search index...

    Function next

    • load the next level, and return a promise that settles once the level is in the world.

      With no level to go to this reports false WITHOUT loading anything, and the promise form resolves false rather than rejecting: running out of levels is an ordinary outcome, not an error.

      Parameters

      Returns Promise<boolean>

      resolves true, or false if there is no next level

      await me.level.next({ async: true });
      
    • load the next level.

      With no level to go to this reports false WITHOUT loading anything, and the promise form resolves false rather than rejecting: running out of levels is an ordinary outcome, not an error.

      While the game loop is running the load is deferred to a timer, so this returns before anything is in the world — see level.load.

      Parameters

      • Optionaloptions: LevelLoadOptions & { async?: false }

        additional optional parameters

      Returns boolean

      true if the next level was loaded, false if there is none