Hello!
I’ve just started to do a menu system and I need some help with understanding of some things.
As far as I’ve understood the whole game is divided into scenes.
-
Am I right if I think that each state of menu is a different scene ? For example, I have 3 menu items at the beginning: NewGame, Shop, Exit. And I chose the “Shop”. Should I create a new scene to the new interface of shop ?
-
You see, I can’t get the idea of working with scenes at all. For example, there is a scene that I have just created. And I want to move to a new scene. I have 2 variants of acting:
a) I could do replaceScene and, as far as I understood, this will release the previous scene with all its data.
b) I could use pushScene/popScene. But in this case I don’t understand how to leave the main scene in memory without deleting its data. And again example:
the simple process in the game: menu> GameProcess> menu> GameProcess> menu -> exit;
in the code it will be like that:
pushScene(menu);
pushScene(GameProcess);
popScene();
pushScene(GameProcess);
popScene();
popScene();
But I don’t want to recreate GameProcess scene each time I move back to menu! What could I do ?
Thanks in advance.