Wednesday, February 4, 2009

PyGame Presentation

It's been a while since I posted, I know, but I've been busy. Here's one of the things that's been occupying my time. I worked up a 2d top-down collecting game demo for the Drexel Game Developer's Group, and a presentation to go along with it. I'm only a week behind schedule for posting it, which is easily attributable to my laziness.


Here's the presentation:





And here's a link to the code:


You need to have python and pygame installed to run it, but other than that, just execute runner.py.

1 comment:

WorldMaker said...

Hey, nice post!

I just wanted to point out that Python has a lot of rich markup support beyond just XML. XML is fine, but sometimes overly-verbose and not always the best choice. Particularly, XML can be a bit off-putting to someone just trying to write a quick game and other data serilization techniques may be preferable.

If you are working with just Python and Python-based tools Pickles can be useful "quick and dirty solution".

JSON support is now included out of the box with Python. JSON is certainly a markup style that more and more tools and languages use and/or can handle (thanks to "AJAX"), and can be surprisingly useful outside of web applications.

http://docs.python.org/library/json.html

Some people prefer YAML as more human readable/editable over JSON/XML or many other markup formats:

http://www.yaml.org/

PyYAML (linked from the YAML main site) is really easy to use in my small experience with it.

Finally, for working with XML in Python I prefer the API of xml.etree over xml.dom(.minidom):

http://docs.python.org/library/xml.etree.elementtree.html

I think it is easier to use and more "pythonic", but to each their own. Python has a wildly powerful standard library, and XML is an area where it is almost "too rich".