Please unconfuse me about the lifecycle of scenes

My game has nine sequential scenes + one constant parallel scene to maintain the HUD.
HTML login stuff precedes the Phaser game.

The strategy is to start loading while the player logs in using the HTML,
then launch the HUD (with optional tutorial) and then, one-by-one, each game scene.

I instantiate the new Phaser.Game with scene set to an ordered array of all 10 scenes .
I want the HUD and first scene to load - then wait to be started when the player is ready.

Goal: As Scene n plays, Scene n+1 loads and then waits for Scene n to end.

How? Should these scenes be constructed as active? Should I sleep() them until ready?
It is a texture-heavy game, and I hoped to have only three scenes loaded at once:
the HUD, the scene in play, and the scene loading up “on deck”.

I have tried everything (details available) and I am lost.
.

What do you mean by a scene “loading”?

Samme – Thank you for the response

I would like to run

  1. scene’s constructor
  2. scene’s preload method
  3. phaser’s actual http scene asset load
  4. scene’s create method
    and then sleep as it waits to be woken by the end of the preceeding scene.

(I have solved the problem that Scene 1 can end before Scene 2 is ready, or the reverse)

TIA for any help on how to run the game constructor, the scene constructors, etc.
Right now each runs a scene.sleep() at the end of its create method.

How do you tell the sceneManager to start a new scene that is already in the scene array so that it will run preload, load and create.
Maybe this.scene.start(nextSceneKey)?
Then which method do I call on the outgoing scene? Maybe oldSceneObject.scene.remove() ?
Should the game constructor see each scene as {active:false}?

I have tried every combination of these and each creates a new fury of bad behavior.
Your advice very welcome.

The scene constructor is run when the scene is added to the manager. So after game boot, for every scene.

sleep() at the end of create() should work. Use launch('key') to start a scene that hasn’t started, remove() to remove the old one, wake() to wake a sleeping one.

In the game scene config active: true means start the scene. Likely only one or two need that.

Use phaser-plugin-scene-watcher to monitor these things.

Thank you for helping me understand the system.
The answer you gave is instructive
but so was the question you asked…
And your tool helps too.

In my tree of scene classes It is problematic to sleep() at the end of create().
Is there a way just to tell the scene manager to preload and load a scene
and only call create() and the update loop later?

No, create() will always follow load complete.