2007.05.14

Pygame: game programming in Python

Those of you who want to relax with a game or two in between coding sessions should definitely check out http://pygame.org. Pygame is a library for developing games and multimedia applications in Python.

The pygame site contains documentation and tutorials on pygame programming, but also lists games and demos that are developed using pygame. Some of the games listed there are really good. I’ll probably write up on some of the better ones when I have a little bit of spare time.

Also, don’t forget that the games listed on the site are an excellent source of knowledge for those who want to learn how to program games as well. There are a few relatively basic games that you might want to start out with.

Games not your cup of tea, you say? Not a problem, the pygame site also links to a few other applications that use pygame. Currently, most (but not all) relate to games in some way, but with time you may find more applications coming out that use pygame.

Pygame is written on top of Simple DirectMedia Layer, a library for developing multimedia applications. Therefore, it’s uses extend beyond the arena of games. You could, for instance, create music players or presentation programs using pygame (and both of these have already been done. If you’re studying physics, you could use pygame to write a program to visualize projectile motion, just to give a single example.

Pygame is obviously not the only library available for writing multimedia applications. And it might not even be the best (I won’t go into that discussion). But if you look at the long list of games, demos and other applications that are using it, you will see that it definitely has a large following. It’s worth checking out. And while you’re at it, you could take a look at SDL as well.

So do yourself a favor and head off to the pygame site. I’m sure you won’t be disappointed.