A tower defence game
Pathfinding, waves, and a lot of systems talking to each other.
Build time ~1 day
Tower defence is a step up from Snake and a step down from a platformer's physics. The interesting problems are pathfinding, wave design and the interaction between systems.
1. The path comes first
Enemies follow a route from spawn to goal. Two designs, and the choice shapes everything else.
Fixed path — you define the route, towers go beside it. Simpler, and most classic tower defence works this way.
Open field — players build walls and enemies path around them, which means running pathfinding whenever building changes, and preventing the player from sealing the route entirely.
Build a tower defence core. Canvas, one file. - A grid map with a <fixed path / buildable field — I want the fixed path to start>. - Enemies moving along the path with speed and health, dying and reaching the goal handled separately. - Towers placed on valid tiles, with range, damage and fire rate. Target selection: nearest, or furthest along the path? Say which and why. - Waves defined as data — a list of what spawns, when, in what order. - Money from kills, spent on towers. Everything tunable from one config object.
2. Target selection matters more than damage
"Nearest enemy" feels intuitive and plays badly — towers switch targets constantly and enemies leak through. "Furthest along the path" is the standard choice because it prioritises the ones about to escape.
Making this selectable per tower is a real strategic mechanic for almost no code.
3. Waves as data
Define waves in a data file, not code. It's the part you'll iterate on most, and being able to tweak a wave without touching logic is what lets you actually balance the game.
4. Balance is the whole game
Tower cost versus enemy health versus money earned. Get it wrong in either direction and the game is boring. Build in a fast-forward button early — you cannot balance a game you have to play at normal speed twenty times.
Log how much money the player has at the end of each wave. A flat line means the economy is stalled; runaway growth means towers are too cheap.