Python DevCenter
oreilly.comSafari Books Online.Conferences.

advertisement


Python News

Python Gaming with pygame

05/10/2001

Somehow I missed or don't remember Solar Fox when I was playing arcades in the early 80's. PacMan ate most of my quarters back then. It's too bad, Solar Fox may have taken its share. Solar Fox is a cross between a shooter and PacMan. Instead of ghosts chasing you, sentinels move up and down the sides of your screen, shooting at you as you gather up fuzors, the solar energy cells Earth needs to stave off a global war over its dwindling resources.

Now, in these days of occasional rolling blackouts and debate over drilling ANWR for oil to free us from foreign dependence, there is an updated Solar Fox for you to play. Pete Shinners recently announced Solar Wolf. Written in Python using the pygame interface to the Simple DirectMedia Library (SDL), Solar Wolf is modeled after the Atari 2600 port of Solar Fox. It features an updated soundtrack and fancier graphics, but it is the same basic game. You eat those energy cells and try not to get hit.

When you are done playing, take a look under the hood. If you ever wanted to try your hand at writing an arcade game, dissecting this game would be easy way to get started. Leaning on the strength of SDL and the pygame bindings, Solar Wolf is a small program with less than 100 Kbytes in program code. The game handler, gameplay.py, is only 420 lines long.

Stephen Figgins administrates Linux servers for Sunflower Broadband, a cable company.


Read more Python News columns.





Sponsored by: