[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Game Framework
While working on a self-teaching project, I came up with a better way to
organize game states and events than what I'd been doing, with some help
from the GameDev forums.
The code at:
http://kschnee.xepher.net/code/framework.py.txt
shows the new framework code, in a demo that displays a flickering blue
square.
Also see:
http://kschnee.xepher.net/code/acorn.py.txt
This code does nothing, but does it elegantly. It's a cleaned-up version
of the first file, which I'm now using as a basis for something else.
It's public domain, if you can make use of it.
I'd appreciate critiques to improve the thing too. I'm not sure of the
best way to store information between states; I guess info can be stored
in the game's World object. Also I'm using a separate View object to
store the graphics and do drawing, which is more MVC-ish but less
efficient than it could be. Thoughts?