Retain level through scene change (Storyboard)

I have 2 scenes and 3 files (2 of which the scene files). The first scene’s purpose is to load generate the level. This scene imports the level generator and generates the level. After generating, I pass the level on to the second scene, which is the actual game scene.

The problem is that I while generating the level, I insert all images and such, so they’re created in the loading scene. Thus, when I switch to the second scene, the level is “lost”. How can I make it so the whole scene is passed over to the game scene?

You can’t really do that.  Scene’s are meant to represent a single screen.  You can’t have one scene do work and another scene be the display.  Now it’s possible to have a module that will return a display group and then put the display group into the scene’s view.   But generally you’re going to create the scene’s object in the scene’s code. 

If your scene is complex, you can call composer.loadScene() to preload  your scene before you go to it.

Rob

You can’t really do that.  Scene’s are meant to represent a single screen.  You can’t have one scene do work and another scene be the display.  Now it’s possible to have a module that will return a display group and then put the display group into the scene’s view.   But generally you’re going to create the scene’s object in the scene’s code. 

If your scene is complex, you can call composer.loadScene() to preload  your scene before you go to it.

Rob