Learning PyGame

Posted on March 05, 2013

Like many others, I  grew up playing video games (among other things, of course). I always had a fascination for them, and like for many others, video games seemed like magic to me – that was until 2011 when I tackled jMonkeyEngine. Alas, I didn’t have  enough solid knowledge about Java and I stopped wondering about game development for a while, not to mention that’s it’s a hell of a challenge to develop a decent 3D game by yourself.

Recently, the Android phones my family bought has inspired me to make a game that I haven’t yet seen on portable devices. I wanted to make a 2D shooter. Why 2D? Because 3D fps are very cumbersome on touch devices due to an overwhelming amount of controls. How can you control two d-pads while controlling a shoot button? The aiming process is painful! That’s why I want to make a simple, yet fun online multiplayer 2d shooter platformer for Android. I think of it as Quake ported to 2D.

I chose PyGame over Slick2D for a very simple reason. PyGame may not be as cross-platform as Slick2D, but the only things I’m missing are iOS and the web. I know Python way better than I do Java. Python is my language of choice because it’s prominent on the RaspberryPi and also supports lots of useful modules for robotics, such as SimpleCV.

To learn PyGame, I started with the free book called Making Games with Python and Pygame. Unfortunately, it didn’t offer in-depth explanations of PyGame and used more of a case-study approach (almost ressembling a cookbook). In my opinion, it suffered from this cookbook approach because the user was limited to learning only what specific projects had to offer. I didn’t find it very useful for getting started with my game. That’s why I migrated to this. It approaches PyGame by explaining how it works and how to implement different features. It’s easier to apply learnt content to your own game. In conjunction with the PyGame reference page, it’s a great way to get started. So if you want to make a 2D game yourself, go ahead!