Roguelike Dungeon — BSP Generation, Shadowcast FOV, Item Synergies
BSP dungeon gen, shadowcast FOV, six enemy AIs, eight item categories, real synergies, and permadeath. A pocket Brogue in one HTML file.
What this is
Twelve descending dungeon levels of glowing ASCII. BSP partitioning carves rectangular rooms and connects them with L-shaped corridors. Shadowcast FOV reveals geometry crisply; explored tiles dim to 35% so you remember the map. Six enemy archetypes with distinct AI: rats swarm and stack damage, kobolds shoot with line-of-sight bresenham, trolls regenerate unless burning, dragons exhale a three-tile cone of fire that ignores walls, ghosts phase through walls and drain XP, liches summon skeletons and cast ice rays. Eight item categories — weapons, armor, potions, scrolls, wands, rings, amulets, food — with named synergies that surface as soft-green hints when you find a combination ("flame brand + ring of fire — every strike ignites"). Move with arrows or hjkl. i for inventory, > to descend. Death wipes everything. Permadeath. Press a key to begin the descent.
Why this is mind-blowing
Roguelikes are usually long projects because so many systems must compose without breaking — generation, scheduling, FOV, AI, items, balance, death state. This one composes them all in 51KB of one file, and the shadowBlur halo on every glyph turns ASCII into something that genuinely feels like a dungeon. Smoke-tested with 5,000 random keypresses; the game survives every kind of death and starts the next descent.
Single-file Brogue-style roguelike in Canvas. Procedural BSP dungeon gen. Turn-based player + monster scheduling. FOV via shadow casting. Item synergies — wand of fireball + ring of fire = bigger explosions. 6 enemy types (rat, kobold, troll, dragon, ghost, lich) with distinct behaviors. 8 item categories. Perma-death. ASCII or low-poly tile rendering with glowing accents.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Energy scheduling — every actor accrues speed per tick, the highest-energy actor acts — is the cleanest way to get heterogeneous turn rates without a mess of if-statements. Players, monsters, and projectiles all share one loop.
- Recursive shadowcasting in eight octants is not as scary as it sounds: 30 lines of JS, and FOV is correct on dungeon corners and column rooms in one shot.
- Item synergies should live as named, in-line modifiers (not a generic effect system) — the surface area is small, the discovery moments are explicit, and the player learns vocabulary instead of stats.