Completely Destroying a scene

I am having problems switching levels in my game. This may sound odd, but my game is separated into 3 menus (1 for each level) and there are arrow buttons that allow the user to switch between menus to get to the different levels. When I play a level, everything seems to work fine and when the game is finished, it returns to its corresponding menu. If I do something such as play level 1, go back to the menu. Then play level 2, go back to the corresponding menu and play level 3, then go back to the menu, it works fine. The problem is this: if i do something such as play level 1, then play level 2, and come back to play level 1 the game loads the level 2 scene. I believe this has something to do with the storyboard modules, but otherwise I’m stuck. I’ve looked at the corona documentation for removing scenes, and that hasn’t proved to be useful to me. I would really appreciate someones help as I have a complete game and this is holding me up from publishing it.

Thank you

Just out of the top of my head it seems that you creates the level 1 scene, then creates level 2 scene and when switching back there is nothing new to be created in the enterScene so Corona reads it as level 1 has been completed and therefore it goes to level 2 again.

Have a look at these two:

http://www.coronalabs.com/blog/2013/04/02/cleaning-up-display-objects-andlisteners/

https://coronalabs.com/blog/2012/07/31/storyboard-scene-purging-vs-removal/

If you still can’t figure it out please post some code and I’ll have a look at it.

Best regards,

Tomas

I would suggest that watch this tutorial:  http://www.coronalabs.com/blog/2013/08/20/tutorial-reloading-storyboard-scenes/

Rob

Thank you for the links. I will make some changes to my kind and it will hopefully work. I’ll get back to you to let you know how it goes and if I need further assistance.

Thanks for the link, I was able to resolve my issue

Just out of the top of my head it seems that you creates the level 1 scene, then creates level 2 scene and when switching back there is nothing new to be created in the enterScene so Corona reads it as level 1 has been completed and therefore it goes to level 2 again.

Have a look at these two:

http://www.coronalabs.com/blog/2013/04/02/cleaning-up-display-objects-andlisteners/

https://coronalabs.com/blog/2012/07/31/storyboard-scene-purging-vs-removal/

If you still can’t figure it out please post some code and I’ll have a look at it.

Best regards,

Tomas

I would suggest that watch this tutorial:  http://www.coronalabs.com/blog/2013/08/20/tutorial-reloading-storyboard-scenes/

Rob

Thank you for the links. I will make some changes to my kind and it will hopefully work. I’ll get back to you to let you know how it goes and if I need further assistance.

Thanks for the link, I was able to resolve my issue