Connecting Scenes and Modules

Hi,

I´m working on a game with 10 levels. Every level goes into a folder, so there are ten folders (level 1, level 2, level 3,…). Every level folder contains about 4 modules (game, basket, bullet, bar). I´m looking for a way to connect the main.lua (or menu.lua) file to each of these levels, contained in a folder using the director class.

I know the basics, how to link the menu.lua script with e.g. the game script, but I don´t seem to manage the game script to continue communicating with the other modules (basket, bullet, bar). How do I integrate both. Schould I wrap the module code into the new function and put all the Displayobjects into a newGroup ? Or is there a way to use the director scene to connect to one file (the game file) and have that communicate to it´s modules ?

The best I´ve been able to do is load one level after touching a button on the menu, without having the menu itself dissapear.

Hope it makes sense.

Thanks !!

Jan [import]uid: 126207 topic_id: 29277 reply_id: 329277[/import]

I am not sure of what you are doing but maybe you could use the storyboard api : it helps you to send parameters from one scene to another, then you could get data wherever you want with a storyboard.gotoScene (effect, duration, options). In options, you put a table with parameters, then you can get them on the next scene with event.params.
[import]uid: 5578 topic_id: 29277 reply_id: 117770[/import]

Well, I have different modules that are loaded into the game.lua file. When I try to change to the game.lua file from the menu.lua file using the director class, the game.lua file no longer triggers all the modules it is supposed to.

I only know my way around the director class (there are great video tutorials on that, which makes it easier to learn :wink: ). I´m pretty sure it is just a couple of lines of code that I´m missing to make sure the modules are still triggered by the game.lua file when changing to it from the menu but I can´t seem to find it. [import]uid: 126207 topic_id: 29277 reply_id: 117785[/import]