Transition to a scene that uses Modules

Hi Guys,

I have a game where you can switch to levels from a menu.

The level you switch to (a game.lua file) requires modules with display objects. Like so:

[lua]local bar = require (“bar”)
local basket = require (“basket”)
local bullet = require(“bullet”)[/lua]

The problem is that I don´t find a way to purge the entire game.lua file, display objects from it´s modules bar, basket and bullet included when I change back to the menu.

I tried muddling the seperate modules (bar, basket and bullet) into a storyboard scene themselves, but that didn´t work as could be expected.

Any help on how to use the storyboard to purge the display objects from modules required by a scene so that you can switch back and forth between the menu and the game.lua file ?

P.S. the Storyboard Forum was not displayed in the forums field options when creating this forum topic, so I posted it here.

[import]uid: 126207 topic_id: 29731 reply_id: 329731[/import]

If you make sure you add all of your display objects(which can be displayGroups as well) to the storyboards scene.view then it will take care of the clean up for you.

I usually end up a non-local group that i stick into the scene.view on the createScene event. All other groups/objects get inserted into that non-local group. I gather some people would say it isn’t the best way but whatever. It works with no issues.
[import]uid: 147305 topic_id: 29731 reply_id: 119343[/import]

So you make the group = scene.view a non local group and add the display objects from other modules to it ?

Sounds like a good idea, I´ll try it out. Thans ! [import]uid: 126207 topic_id: 29731 reply_id: 119357[/import]