← all kitsgenre kit

tower-defense

paths, towers, endless

kits = ["tower-defense"] in dreamsy.toml, then local TD = require("@kit/tower-defense"). Data-driven tower defense: maps from TileMap2D grids or waypoint paths, enemies / towers / waves / levels / campaign from JSON, a deterministic Sim, a View (entities, radial build/upgrade menus, range preview), a portrait Hud, Campaign progress + save, and a headless balance bot. Golden example: games/examples/kit-tower-defense ("Bramble Watch": 3-level campaign, 5 towers × 2 branches, 7 enemies + boss, endless).

All sim positions are in tiles (cell (c, r) spans [c, c+1) × [r, r+1), center (c+0.5, r+0.5); row 0 = top). Speeds are tiles/s, ranges and radii are tiles. The View converts with the map's position + tile_size.

Example game

Bramble Watch running on the Dreamsy engine

Bramble Watch

Garden critters guard the seed vault from beetle swarms. Three levels and endless mode.

tower-defensetop-down

Full reference on GitHub