Tower Defence prototype code

Today I’m happy to offer some code from my early prototypes of “Tower Defence.” It’s super basic: No maze generating algorithms yet, not much in the way of gameplay.

A random maze is created (i.e, each map tile is 50/50 whether its walkable or not), start and end points generated and a route found between them using A*, and an “enemy” (green square) moves along the path. You can create a single weapon type – the gun – which fires very slow moving bullets at the enemy.

This code also contains remnants of my quick and dirty collision system, though Box2D is actually running the show.

Untitled


Go ahead and download this prototype code and prepare for “weird bugs.”