Hi, im having a hard time trying to do something it might be easier in another way.
Basically, what i have is:
-main.lua : where i just gotoscene “level01” and some other random stuff
-level01: display objects, audio, function to go level 02, other functions
-level02: same as level 01 but function to go level 01
Now i’m having some questions about display objects/audio/even listeners changing scenes.
I want to change between level01 and level02 (basic interaction is done) but load the level again if i want to. For example, im on level 01,changes to level 02 (level 01 gets destroyed). But during level 02 i want to go back to level01 and create all the display objects / load audios / etc.
I tried putting all that into the enterscene function but i have problems with other functions in the module, specially when i make a evenlistener such as (button01:addEventListener(“touch”,x)) and button01 is declared inside the enterscene function.
I don’t know if i’ve explained it ok, but any help is appreciated.
Thanks.