← Devlog

Cinderwatch: a tower defense that plays itself, in one HTML file

Ideas worth keeping Posted tower-defensethreejssingle-file

Runs right in your browser. It's a 3D game, so a recent phone or computer works best. Open full screen ↗ Cinderwatch by kevintngo · source code · MIT License

This branch is where I keep clever games and ideas made by other people. The first one is Cinderwatch by kevintngo, a 3D isometric tower defense. It’s open source under the MIT License, so I’ve put a playable copy right here. All the work is the author’s; I only host it and note why I like it.

Press Play the demo above. You don’t need to do anything: an AI commander builds and fights from the moment the page opens.

Why I collected it

It plays itself, and you can take over at any time. Your first command puts you in charge, and tapping the commander plate hands the battle back. Opening the page drops you into a fight already in progress, like the attract mode on an old arcade cabinet. That suits someone arriving from a short video who only gives it a few seconds.

One HTML file, no asset files. Every model, texture and sound is generated in code. The whole game is a single file of about 1 MB that even runs straight from disk, with no server.

Light is the main character. A flickering beacon, a brazier on each tower, flaming arrows, cannon flashes and chain lightning. The scene is drawn at about half resolution, then dithered, tilt-shifted, vignetted and grained, so it looks like a tabletop miniature.

The battlefield rebuilds itself. After each boss the ground crumbles away and a new map with a different road assembles out of the dark, across five lands: a mountain pass, snow, a bog, a lava scar and a desert.

The five lands of Cinderwatch

What’s in it

  • Four towers with three levels each: archer tower, bombard, storm spire and guard post.
  • Twenty kinds of monster, each with its own trick: slimes that split, wraiths that arrows pass through, necromancers that raise skeletons, war drummers that speed up everything near them.
  • A boss every fifth wave, one per land.

Playing on a phone

  • Tap an empty pad to open the build menu.
  • Tap a built tower to upgrade or sell it.
  • Tap the wave plate to call the next wave early.
  • Tap the commander plate to hand the battle to the AI, or take it back.
  • Drag to move, pinch to zoom.

On a computer there are shortcuts too: 1 to 4 pick a tower, Space calls a wave early, Tab changes speed. The full list is in the author’s README.

What I’m taking from it

The idea I most want to borrow is the self-playing mode. A game with a demo that runs itself is a trailer and a free trial at once, and it holds the viewer through the first few seconds, which is exactly when they decide whether to stay.