Hi all,
I was wondering is there a way to implement a game scene can be stopped and then can return to the same state after all (that the scene can resume), with SceneManager. For example, in a game level screen (scene) the user presses an options button and then the game goes to another different scene; after the user change some setting (or not) then he selects to continue the game and he could continue the game in the same point he left (the scene for the level screen with their event listeners, etc. as were left). As SceneManager does everytime you change from one scene to another, the new scene is created from scratch (the events are created again, etc.).
I guess one approach is to save and manage globally the different scene objects but I want to know if there is an implemented class or useful function (or code snippet) to do this.
Thanks.
Comments
Like have a global variable ggameScene
so you could save the state as:
http://www.giderosmobile.com/forum/discussion/1194/popup-in-scene-manager#Item_11
Best regards
I need to pause/resume the state between scenes but your "popup" implementation could be a solution. In fact, I have used until now the Popup class included in the @ar2rsawseen GameTemplate for a similar requirement but I had to get the control over the event listeners,etc by myself.
In your BhPopup I have seen you have implemented a "ignoreTouches" method for that purpose. That's ok for the background buttons (or other objects) but I need to add event listeners and others objects also in the foreground popup. Anyway I have to test it.
Btw, I appreciate a lot your help. Reading your blog, posts and comments I've learned a lot.
Best regards,
David (@SimplesApps).
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989
I think these kind of functions (stopping/resuming the state) could be added to the Game Template.
https://play.google.com/store/apps/developer?id=SimplesApps
http://www.amazon.com/gp/mas/dl/android?p=com.simplesapps.actionbasket
https://itunes.apple.com/artist/david-rodriguez/id763996989