The gap
Tower defence balance breaks easily: one change to a tower or an enemy can make a map impossible or trivial, and playtesting every map after each change is slow.
Game templates
The complete TypeScript and three.js source of Hedgehold 2.0, a tower defence with its own rule: a living hedge grows every wave, gates the path and smothers towers, and the player keeps or cuts it with two snips a wave. Every map is proven fair by a bot.
Coming soon
Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.
The gap
Tower defence balance breaks easily: one change to a tower or an enemy can make a map impossible or trivial, and playtesting every map after each change is slow.
What it is
A finished, tested tower defence game whose maps are proven fair by a bot in seconds, with its towers, enemies and maps in one config file.
How you use it
Unzip, run npm ci and npm run dev, then edit src/game.config.ts; npm test checks the game again in seconds.
Source code of a real, playable game to reskin and learn from, with its proofs built into the tests.
Use it when
Built for
A living hedge grows from fixed roots every wave: buds show where, gates hold enemies on the path, hedge on a pad smothers the tower, and two snips a wave decide what stays. All of it lives in rules.hedge and the core simulation, with tests.
Title, save key, rules, economy, four towers with three levels, six enemies, maps drawn as text, the daily map, colours and sound.
On every npm test a build-order bot wins all twelve maps and 30 daily maps with three stars, while doing nothing and a two-tower build lose.
Twelve gardens with hedge roots and a daily map, wave previews, early calls, upgrades and selling, save slots and an autosave, x1/x2 speed, stars and unlocks, keyboard, mouse, touch and gamepad, landscape and portrait.
61 unit tests and Playwright browser runs, a size budget, an upload zip for itch.io or any static host, and a step-by-step guide to new maps, towers and enemies.
1 of 3
| Platform or runtime | Supported versions | Tested up to |
|---|---|---|
| Node.js | 22.12 or newer | Not stated |
The template is finished and tested. It is not on sale yet; this page will say where to get it when it is.
Coming soon
Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.