Roguelike / physics sandbox
Falling-Sand Alchemy Roguelike With a Four-Spell Wand
Tested with Claude · produced CINDERDEEP: Falling Sand Roguelike
The Prompt
Build a falling-sand alchemy roguelike in ONE self-contained HTML file (inline CSS/JS, Canvas 2D). No libraries, no image assets: every material is a pixel simulated by a cellular automaton, with a palette defined in code. Simulation core: - Fixed-resolution grid (for example 480x270 cells) upscaled to the canvas with nearest-neighbour, so pixels read as pixels. - Update on a fixed 60Hz tick with two alternating scan directions to avoid directional bias. Never run simulation steps inside requestAnimationFrame with a variable delta. - Materials: empty, stone, dirt, sand, gravel, wood, oil, water, lava, acid, gunpowder, gas, smoke, steam, ice, gold. Reactions must live in one data table, not in special-case code: water + lava -> stone + steam; water + fire -> steam; oil + fire -> burning oil; acid + stone -> acid + empty; gunpowder + fire -> explosion; ice + fire -> water; steam rises and condenses back to water after N ticks. - Fire is a state on flammable cells with a lifetime, spread chance and smoke emission, not a separate global system. - Conserve mass: a cell that moves leaves empty behind. Any reaction that deletes mass must be listed explicitly in a debug panel. - Ceilings: when a supporting cell is removed, unsupported stone and dirt fall after a short settle delay with a dust puff. No floating islands. Spells: - Four-slot wand, each slot holding one of 20 spells. Every spell must inject material or apply a state to the grid; no spell may be a pure particle effect. - Required 12: water jet, oil spray, powder trail, spark bolt, arc lightning (conducts through water and metal cells and can hit the caster), frost lance, dissolve ray, blast keg, blink, sandstorm, lava pour, shield bubble. - Casting costs mana (100 max, about 8/s regen) with per-spell cooldowns. Hold-to-stream for jet spells at a reduced rate. Run structure: - Five depths of increasing material complexity: a mine (sand, wood, water), a hollow (gas, acid, spreading fungus), a vault (ice), a foundry (lava, metal) and the Cinderdeep (all of it). - Each depth ends in a vault with a healing font that works once, a descent tile and a three-choice gift: spell, wand modifier or perk. - Boss arenas on depths 2, 4 and 5, each with at least one material-based weak point. A boss that can only be killed by raw DPS is a failed design. - Score = gold collected + depth x 100 + kills x 10 + bosses x 250. Persist the best score locally. Controls and platform: - Desktop: A/D move, W or Space jump then hold to levitate on a fuel bar, S digs down, mouse aims, click casts, 1-4 select spells, E interacts, P pauses. - Mobile: fixed D-pad, a drag-to-aim-and-cast pad, tappable spell slots, and safe-area padding. - Bilingual English and Chinese string table, switchable from the pause menu. Performance and testing: - Target 60fps on a mid-range phone at 480x270 cells. Use typed arrays (Uint8Array) for the grid, avoid per-cell allocation and redraw only dirty regions. - Write a headless harness that runs 10,000 ticks and reports: mass created and destroyed per material, cells updated per tick, and any material that ends up NaN or permanently stuck. - Run 30 random-input runs and report average depth reached, deaths caused by the player's own spell, and rooms where all reachable gold was exhausted. Deliver in stages: grid and falling sand first, then the reaction table, then the wand, then depth generation, then vaults and bosses. Print the reaction table and the mass-conservation report at the end.
What This Prompt Produces
CINDERDEEP is the reference: 20 spells, a four-slot wand, five depths and three bosses layered on top of a real falling-sand simulation, built with Claude Fable 5.2. The single reaction table is what makes the cave feel like a system rather than a list of scripted traps.
Modification Tips
- Keep every material interaction in one table. Once reactions live in if-statements, adding lava breaks water and you can no longer test the system.
- Conserve mass and report leaks. Players notice when pouring water slowly floods the world, even if they cannot say why.
- Make spells inject material, not particles. Tide Jet is interesting because the water stays, flows and cools lava into a bridge.
- Alternate the scan direction each tick. A single-direction falling-sand update produces caves that visibly drift to one side.
The Game This Prompt Produced
Want to try it? Open Claude, paste the prompt, and you'll have a playable game in minutes. When you're happy with the result, submit it to Daily AI Games.