I Made Asteroids
Wednesday, November 18th, 2009
I stayed home sick today, and made a little browser asteroids game on my laptop. The cool part is, it doesn’t need Flash or any other plugin. It’s all JavaScript. The even cooler part is, I am still blissfully ignorant about JavaScript, I wrote the whole thing in Python, using Pyjamas. I’ve tested it on Firefox and Safari, works great on both, and runs super smooth even with lots of asteroids.
It’s not much of a game, really, just classic Asteroids without even scores or keeping track of ships or much of anything but the basics. But it’s only about 300 lines of Python, and it runs in any off the shelf browser.
I’ll try to add some polish to it and get the source up somewhere soon for anyone interested. I’m pretty happy I managed to do all that in a day, plus a few hours on previous days getting Pyjamas set up.
Update (11/19): I uploaded the source code. It’s not the best code I’ve ever written, and it’s not commented at all, but now it’s a real project! Sort of.
Update (11/20): Version 0.2 is now live, with sound effects, a score, and a different Canvas object that allows it to run in IE6. It’s too slow to be playable in IE6, but at least it runs.
