PyWeek - Kaos

My entry to the PyWeek #15. Play it in your browser (only recent Firefox/Chrome and fast CPU work):

Oh, and since I forgot in the readme and don't want to make another submission just for that - all artwork is from



Give this entry an award

Ratings (show detail)

Overall: 3.2
Fun: 2.5
Production: 3.4
Innovation: 3.8

Respondents: 16
Files: Uploader Date
Kaos by Allefant.zipfinal 1.32 Mbytes allefant 2012/09/15 17:36
final submission
Screenshot - 09152012 - 07:02:06 PM.png 41.23 Kbytes allefant 2012/09/15 17:02
Screenshot - 09152012 - 03:19:07 PM.png 20.46 Kbytes allefant 2012/09/15 13:24

Saturday 15 September, 2012

[ allefant @ 17:09 ] done

I think I'll stop here. There's a win condition and a loss condition. And I figured out how to modify the HTML on the page so you get a log there what is going on. The darkness also looks nicer now.

My experiment to use Python3 for HTML games is basically successful. The outcome is that pyjs needs a lot of work to produce more efficient Javascript (or browsers need to do HTML5 more efficiently, I never used Javascript/HTML5 myself since I refuse to code in anything but Python - therefore not sure if native code would be much faster). I really missed WebGL support, I think that may have helped a lot.

Also some language constructs like super() don't seem to work properly yet. But I suppose I should simply file a bug report about that and they'd fix it.

The final version (As submission I'll put the .py sources plus the exact same .html files into a .zip) is here:

[ allefant @ 13:26 ] final day

Final day already, which kinda is the first day for me as well this time. I didn't get to work on pyweek on Sunday, then had to work Monday through Friday. With no free evenings on Monday, Tuesday and Wednesday :( So what I did was use Thursday evening and Friday evening for playing around a bit with pyjs, a python to javascript compiler.

This allows me to write a game in 100% standard Python3, but then translate it into Javascript (a rather slow Javascript as it's completely dynamic like Python). The result seems to only work fast enough in Firefox and on a rather fast i7. Still, I wanted to try Python3 instead of Python2 as well as something new besides just the standard CPython so I'm happy.

Now the game itself is nothing great. The idea is that you walk around but it's a one-way-trip, i.e. you can never step back. The map behind the player simply disappears. This screenshot should make it clear (I hope to improve graphics a bit still and not just have all black tiles):