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