Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
trail.py | 2009-06-30 02:03 | 2.4K | ||
particles.py | 2009-06-30 02:03 | 841 | ||
munch.py | 2009-06-30 02:03 | 594 | ||
draw.py | 2009-06-30 02:03 | 614 | ||
On http://wiki.python.org.il/Meeting_30_January_2007, I gave a lecture about Pygame (an SDL wrapper) and Numeric, bridged by the pygame.surfarray module.
There were no slides but these code examples were presented, together with interactive usage. The libraries have extensive documentation and nice tutorials. For the particular topic of combining Pygame with Numeric, see see the surfarray introduction tutorial.
I wanted to implement a game where by waving around your "magic wand" (== mouse) you can create clouds of "raw magic" that move around and interact between them. A goal can be defined then, e.g. hit the opponent's (assuming networking or AI) side of the screen with as much of your magic as possible, while defending your side from his magic. This led me to entitle the lecture "Pygame, Numeric and magic fields", which created confusion (people probably assumed that I meant "fields" in the OO sense, i.e. things like __getattr__, while I meant them in the phisical sense :-).
Naturally, I didn't come close to that in the one day I took to prepare, but I did write some simple yet somewhat fun examples that were enough for the purposes of the lecture:
The sites of Pygame and SDL include many games, some of them mature and very enjoyable. Notably, see SolarWolf (written by Pygame's author Pete Shinners).
There are two relevant game competitions: The Ludum Dare 48-hours competition (solo, any language) and the Pyweek challenge (solo/groups, one week, Python). They have similar rules: you can use existing libraries like Pygame but must write all game logic from scratch during the competition time frame. Sounds like lots of fun. The next Pyweek will start on 2007-04-01, and I hope to organize an Israeli team! We'll discuss the details on the Python-IL mailing list...