Thanks
.
How it WorksWhat it does is loop and run a basic update (Grahpics and Input) then it runs the update method.
The update method is the most important part of the idea, it checks what scene you are running and runs the particular update method for that scene.
You'll notice that there are variables set to false in the begining. You will also (in the branched update methods) see something along the lines of -
main_init if !@main
else
end
By putting if !@main, we are checking to see if @main equals false. What it will then run is the preceding method - main_init.
This is what the variables are for, to make sure the scene is initialized properly, and that it doesn't happen more than once.
All you have to do is create all of the windows before the main loop, and update each scene like you normaly would in their respective update method.
This should stay pretty lag free considering it will only run each scene if it's active.
To change the scene, you use -
@scene = A_NUMBER
The number reflects what scene it is. For example, in the given template the main scene (ie: the menu itself) is given the number 0.
This will work unless you for some reason dispose windows inside the scene itself.