Jul 26, 2008

OpenPolitik

I've been a little quieter recently compared to normal, and I'll tell you why now. I've been riding my bike to work, so there is less time in the morning for me to think about what to write in my blog entries while I dodge traffic and retarded pedestrians. And it takes less time to bike to work than to take the bus/metro, so there is less time to think even without distractions. I've also been on vacation for the last week (hooray!) so I've been out and about.

Second, I've been working on a programming project. It is a little app for playing a diplomatic board game that I used to play a lot while in university. Since there are no longer hordes of geeks around for me to play with, I've created an online version for us to play it. You can see it here. I released it under the GPL too, so if you want to see the code it is here. It is written for Google's App Engine, which I wrote about in a previous post.
I have found a few restrictions though. The biggest problem I had was manipulating images. Google doesn't allow you to use the Python imaging library (PIL), you have to use a set of functions that they define. It does things like cropping, resizing, rotating, etc. The basics. However I wanted to be able to update a board, which involves pasting one image onto another one and the engine didn't allow me to do it. I had to do something a bit more involved, where I created pieces and placed them as <img> tags on top of a div that had the background image set to the board, absolutely positioned to where they were supposed to be. In retrospect, this might make it easier later on for an admin to modify the board, using some fancy drag and drop Javascript. Cool.

Anyway, that is my advertisement. If you are interested in playing, just head over to the game and either start a game, or join an existing one. I'm sure you will be more than welcome.

No comments: