Agent brief: single-file HTML5 game
Paste this into an AI coding agent to get a game that uploads to Game Hub first time.
Publish your game
⚑ Report
Log in to report this.
You are building a small browser game that will be uploaded to Game Hub.
## Deliverable
One file, index.html, with all JavaScript and CSS inline. No external libraries or CDNs.
Draw with a <canvas>. Keep it under 2 MB.
## Requirements
1. Scale the canvas to fill the window (it runs in a 16:9 iframe and in full screen) and handle resize.
2. Controls: keyboard (arrows/WASD + space) AND pointer/touch, so it works on phones.
3. Show a title screen, a "press to start" prompt, a score, and a game-over screen with restart.
4. Audio only after the first user input (browsers block autoplay). Generate sounds with WebAudio.
5. Save the high score with try { localStorage } catch {} — storage may be unavailable in the sandbox.
6. No network requests of any kind.
7. Pause when document.hidden is true.
## Before you finish
- Open index.html locally and play it for a full round with both keyboard and mouse.
- Check the browser console has no errors.
- Tell the person: "Upload index.html at Game Hub → Publish. Tick 'Works on phones' if touch works."
## What Game Hub accepts
- A .zip with index.html at the top (or inside one folder), or one self-contained .html file.
- Web files only: HTML, JS, CSS, WASM, images, audio, fonts, engine data. No executables or server code.
- Free plan: 25 MB per game. Creator plan: 200 MB.
- The game runs in a sandboxed iframe on its own domain. It can load its own files with relative paths
(e.g. "assets/player.png", never "/assets/player.png"). It cannot call other websites, open pop-ups,
use cookies or read anything from Game Hub.
- Mark the game "Works on phones" only if it plays with touch alone.