tileedit | leveledit | tganew | levelfancy
algo | ani | engine | fonts | high | html | layout | text | timer | vid
1 | 2 | 3 | 4 | 5
theme | style | widget | surface | const
container | app | table | document | area
form | group
basic | button | input | keysym | slider | select | misc
menus | dialog
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
a state engine.
Template Class -- for a state.
For all of the template methods, they should return None unless they return a new State to switch the engine to.
Template Method - Initialize the state, called once the first time a state is selected.
Template Method - Paint the screen. Called once after the state is selected.
State is responsible for calling pygame.display.flip() or whatever.
Template Method - Request a repaint of this state.
Template Method - Update the screen.
State is responsible for calling pygame.display.update(updates) or whatever.
Template Method - Run a logic loop, called once per frame.
Template Method - Recieve an event.
A state to quit the state engine.
Template Class - The state engine.
Run the state engine, this is a infinite loop (until a quit occurs).
Template Method - called at the beginning of State.run() to initialize things.
Template Method - called once per frame, usually for timer purposes.
Template Method - called with each event, so the engine can capture special events.
Game.event(e): return captured
return a True value if the event is captured and does not need to be passed onto the current state