Diegeist
Play: spskelly.github.io/diegeist
Repo: GitHub
What It Is
A tile-based roguelite dungeon crawler built entirely in vanilla JavaScript. Procedurally generated dungeons, turn-based combat, loot with rarity tiers, class skill trees, and persistent meta-progression between runs. The whole game builds to a single HTML file and runs as an installable PWA, no server, no framework, no external assets at runtime.
This was my first game project, and honestly, a fun way to stretch my own tooling in a direction I enjoy.
Gameplay
- Three classes, Fighter, Archer, Mage, each with distinct skill trees (3 branches, 5 nodes per branch)
- Procedural dungeons, BSP room generation with room archetypes, corridors, start/boss/special rooms
- Turn-based energy system, movement and combat consume energy; strategic resource management matters
- Six enemy AI behaviors, wander, rushdown, ambush, summoner (with minion cap), kiting, patrol
- Melee, ranged, and magic combat, with crit, dodge, and floor-scaled difficulty
- FOV and line of sight, exploration fog reveals the map as you move
- Loot system, rarity tiers, gear-bound skills, belt consumables with auto-refill
- Hub between runs, shop, stash, achievements
- Persistent progression, meta-currency, run history, stash items survive death
- Death-save choice, keep one item or haul all collected materials
Controls
Split input scheme: arrow keys for movement, WASD for directional attacks. Full inventory management with inspect/compare panels, character stats overlay, and skill tree access from the pause menu.
Technical Highlights
Build System
A custom build.js reads 30 source modules in dependency order, strips ES module import/export syntax, and injects the combined code into template.html. It also emits sw.js, manifest.json, and an app icon into dist/. No bundler, just a 100-line build script.
Procedural Audio
All sound effects and ambient audio generate at runtime via the Web Audio API. No audio files, the game synthesizes hit sounds, footsteps, spell effects, and dungeon atmosphere from oscillators and noise generators.
Architecture
30 focused modules covering AI, audio, camera, combat, dungeon generation, entity management, FOV, game state, HUD, input, inventory, items, pathfinding, progression, rendering, resources, skill trees, sprites, and the turn system. ~10,400 lines of source code.
Testing
21 test files using Vitest covering dungeon generation, combat mechanics, inventory logic, save/load, progression, and AI behaviors.
Resource System
Material drops (Timber, Stone, Iron, Crystal, Aether) scale by biome. Resources persist through death and feed into the hub’s progression systems.
Tech Stack
- Language: Vanilla JavaScript (ES modules)
- Rendering: Canvas 2D with adaptive camera zoom and scaled sprite rendering
- Audio: Web Audio API (procedural synthesis)
- Build: Custom concatenation script (Node.js)
- Testing: Vitest (21 test files)
- Distribution: Single HTML file, installable PWA