Build a tiny offline roguelike https://patrickz.ai/learn/offline-roguelike/ OUTCOME Finish a one-room game with save, reload and a deliberate offline test. STACK JavaScript · PWA TRY PATRICK'S VERSION Play Castle of the Winds: https://perfectz.github.io/castleofthewins/ YOU NEED A coding agent, browser and basic comfort running a local development command. 1. Set your boundary Use an original grid and placeholder art. Implement move, wait, one enemy and an exit before procedural generation. 2. Create one room, player and monster Create one room, one player and one monster, plus an exit so a run can end. 3. Use a grid before graphics Represent the world as a grid before adding graphics. Letters or plain shapes are enough. 4. Make turns deterministic Make movement, waiting and the monster’s turn deterministic enough to test: the same moves from the same start give the same result. 5. Save and reload Add save data: store the room and player state, reload the page and confirm the same state comes back. 6. Cache it for offline last Add the PWA manifest and service worker last. Load the built game once online, then reopen the same address offline. LATER (NOT TODAY) - Inventory: Add inventory only after the core loop is fun. - Touch buttons: Add touch buttons that call the same commands as the keyboard. - Procedural rooms: Add procedural generation after the hand-made room plays well. PROMPT Help me build a tiny offline browser roguelike in [JavaScript or TypeScript] in a new practice folder. First version only: one grid room, one player, one enemy, move, wait and an exit, with placeholder art. No procedural generation, inventory or touch buttons yet. List the setup commands before changing any files. Then work in five checkpoints and, after each, tell me how to check it in the browser and which test covers it: 1. One room, one player, one monster and an exit. 2. The world as a grid before any graphics. 3. Deterministic movement, waiting and enemy turns. 4. Save the game state, reload and get the same state back. 5. A manifest and service worker, added last, so the built game reopens offline at the same address. My room theme: [one sentence]. FOLLOW-UP PROMPT Review this input system. Keyboard input, and any touch buttons I add later, must call the same game commands. Identify duplicated logic and propose a command-based interface with examples for move, wait and exit, and show where pick up and inventory would plug in later. EXAMPLE / EXPERIMENT Start a run, move twice, save, reload and confirm the same state. After the production app has cached successfully, disconnect and reopen the exact same origin. CHECK YOUR RESULT [ ] Movement and turn rules are deterministic. [ ] Reload restores the saved room and player state. [ ] Offline behavior is tested after a successful online load. IF IT FAILS A service worker does not make an unvisited site available offline. Test the production build on the same host and record which assets were cached. MY RESULT / NEXT CHANGE