# 3 · A small browser game in one prompt

**Time:** ~45 min · **Level:** beginner · **Needs:** an AI tool, a browser

## Goal
Get a playable mini-game in a single HTML file, then improve it in small steps. The trick is **scope**: one core loop, one screen, one way to lose.

## Prompt (paste this)
```text
Build a single-file browser game: game.html (HTML + CSS + JavaScript, no libraries,
no external requests). Use a <canvas>.

Game: [PICK ONE: "dodge falling blocks", "catch falling coins", "snake", "tiny 2-lane runner"].
Controls: arrow keys / A-D on desktop AND on-screen left/right buttons on mobile.
Rules:
- One core loop only. Score goes up over time or per catch. One way to lose. Restart with Space or a button.
- Difficulty increases slowly (every 10 seconds).
- Show score and best score (save best score in localStorage).
- Simple shapes only (no images or audio files). Pleasant color palette, large readable text.
- Pause with P. 60 fps using requestAnimationFrame; use delta time so speed is the same on all screens.
- Keep it under ~250 lines with short comments.
Before the code, write 3 lines: the core loop, the win/lose condition, and what is OUT of scope.
Output the full file.
```

## Expected result
A game page you can open by double-clicking `game.html`: a moving player, a falling or moving hazard, a rising score, game over screen, restart.

## Troubleshooting
- **Nothing moves / frozen:** open the console (F12), paste the error: "Fix only this error."
- **Feels unfair or too easy:** "Make the first 10 seconds easier and increase speed by 5% every 10 seconds."
- **Too many features creep in:** keep a list "NOT NOW" and add one feature per prompt: sound, particles, power-up, high-score table.
- **Mobile controls missing:** "Add touch buttons, prevent page scroll on touch."
- **Game jam mindset:** if you can't describe the game in one sentence, cut something.

*Tested on: not yet tested (we'll update this)*
