Waders,
I put a little demo of how to implement game states in Wade using the built in scene system.
It is up in the projects section titled - Game States Using Scenes.
It is a rework of my previous game states demo, but instead of rolling my own, I have used wade's built in scene system.
It consists of a couple of .wsc (wade scene same as json) files and their associated behavior .js files.
If you look at the .js files, it should be pretty easy to understand.
Basically there are two type of states
- States which cause the previous state to be wiped
- Overlays which leaves the previous state in place and lay the new state over it. On closing, the overlay scene objects are removed and the previous state resumes.
This is just one way of accomplishing game state management with Wade.
If you dig into the scene methods in the api, there is a lot more functionality than I am using.
Hopefully a tutorial on the scene system will be forthcoming.
However, this example should get you up and running in a short time and keep you main code free of
conditional statements for state management.
The bird animations and background images are courtesy of Bevoulin at opengameart.org under the CC-0 license.
cheers,
Shri