Projects

Concurrent Queues

I wrote a couple lock-free concurrent queues (for two threads, and for any number of threads) just for the fun and challenge of it. The links go to my blog posts about each of them, which in turn have links to the source code on GitHub.

PNGEncoder2

I wrote a better PNG encoder for Flash, which I've imaginatively dubbed PNGEncoder2. It's a lot faster, has better asynchronous support, and includes an implementation of DEFLATE written from scratch! Read my blog post about it, or check it out on GitHub.

Ball Ramp Game

This was a small school assignment that turned out rather well: It's extremely simplistic, yet strangely slightly addictive. A ball goes down a ramp, and when it reaches the end, you advance to the next level. You have to move the ball left and right (and jump) to avoid crates that are in the way. Levels are randomly generated, and get progressively harder (more crates in the way and the ball rolls faster too). I built it using XNA. The physics are fairly good (the ball can bounce off the ridge of the ramp, for instance), and I like the "feel" of the controls. The graphics (except for the background) were all created by others. There's no way to win the game, by the way; after a certain point the levels simply become nearly impossible. If someone ever manages to advance to level 10, let me know -- I've never seen it done :-)

Click here to play it (Windows only). Use the left and right arrows to steer the ball, and spacebar to jump (hint: you can hold space for more airtime).

N-Player Pong

My friend and I wrote this together for a school project. It's a networked multiplayer (LAN only) version of Pong, written in C# for the XNA platform.

There are four sides (and four players) to start with, in a square. If there's less than four players, then AI players take over the remaining paddles -- this makes watching the game interesting even when nobody has joined the game yet!

When a fifth player joins, the square morphs into a pentagon to give the new player room for their paddle. When a sixth joins, the pentagon becomes a hexagon, and so on (it's limited to 12 players because it becomes a bit ridiculous after that). The game also rotates to place each player's paddle at the bottom of the screen.

I had fun getting the physics to work properly: the ball always responds properly to corners, etc. and can never escape the bounds even at very high velocities. The physics engine determines what object moved the most between the last frame and the current frame, and replays the frame with a higher time-step resolution so that the fastest moving object moves one pixel per interval. This then allows pixel-perfect collision detection and resolution at the expense of more computation.

Here's some screenshots! (The lines you see on the server window show the AI's prediction of where the ball's going to go.)

Zombie Plan

Also for a school project, I wrote a 3D Flash game called "Zombie Plan". I ran out of time before I could add features, improve the AI, add levels, etc., but I had a ton of fun making it. I also learnt a lot about Flash!

It's a shooter, but the weapons shoot fruit (bananas, cherries, oranges) instead of bullets :-)

You can play Zombie Plan online. Watch out for the Ooligooloo Whumpers!

The zombies will go towards you, but only if they have a perfect line-of-sight -- so if you hide just around a corner you can see them and shoot fruit without them "seeing" you. Don't stand too close, though, or they'll suck your life just by proximity.