OLPC Game Jam and Python Thoughts

Edit: An executable version of Sort is now available on my site here. There are some bungs in it still, but I’m going to try to get them out soon as I develop the game past the prototype state.

Last weekend, I participated in the OLPC Game Jam, working on games that would run on their XO platform. We were given three days to write a game in PyGame, and considering I’d never used python or PyGame before that Friday I thought I did pretty well.

The game I created was called Sort: a gesture based game about sorting shapes for points. The best way it was described at the Jam was “a combination of Zoop and Set,” which I felt captured it nicely. If there are any problems with the game (besides the programming bugs I mean), it’s that there’s little to know feedback on how you’re doing. One of the requirements of coding for the XO is you shouldn’t use text (because of localization issues), which made scoring feedback hard. I also didn’t have time to integrate backgrounds (to show you where you were when you focus various piles) so was kind of bad too. If anything went right, it was definitely the control scheme. It felt good to gesture towards a pile and have the shape move there, and it worked really well on the XO (and would on any touch pad really), so I’m generally proud of what I created.

A few programming thoughts about programming in Python. First, I will never get used to the whitespace being significant. This is personal preference, and it wouldn’t keep me from programming in the language again, but I still have problems with it.

Second, Python’s implementation of (what amounts to) duck typing, helps a lot when you’re coding fast and don’t want to have to go back and program interfaces. That said, I’d (personally) rather have the compiled language that will tell me when I’ve passed a type wrong. I just make those mistakes way too often, and I hate having to wait until I’ve hit that particular part of the code during a test run to have it fail. I fall into the category of people that prefer compile time errors to run time errors. I alway compile everything at high warning levels, I try to remove all warnings, and I do my best to make sure all of my functions are as type safe as possible. No casting from void* and the like. So, moving to a language where there are no compiler errors was really a complete change in philosophy for me, and it was tough. That said, it’s awesome for a scripting language.

So, given thoughts on Python, yes I like it, and I think it’s great as a prototyping language, especially with PyGame. But, I think I like Ruby as a scripting language better, and I’ll take C++ or C# over it when I’m working on a big project any day. No offense to python, it just all comes down to personal preference.

By the way, if people are interested, I”m probably going to continue working on Sort, to “finish” the prototype at least. After that, I may look into making versions for a few platforms (including my phone maybe?). I’ll also try to get an .exe version on my site soon so people that don’t want to download python and the various modules I used can play it.

Leave a Reply »»