⚡ PromptLoot

Home › Gaming

One-Prompt Browser Game Builder

Vibe code a complete, playable HTML5 game from a single prompt: one file, no build step, runs in any browser.

Build a complete, playable browser game in a single HTML file.

Game idea: [e.g. top-down car soccer, endless runner, tower defense, roguelike dungeon]
Theme and vibe: [e.g. neon synthwave, cozy pixel farm, retro arcade]
Controls: [keyboard WASD + space / mouse / touch]

Requirements:
- One self-contained index.html: inline <style> and <script>, plain JavaScript, Canvas 2D. No libraries, no external assets, no build tools.
- Draw all art with code (shapes, gradients, particles). Generate sound effects with the Web Audio API, muted by default with an M key toggle.
- Fixed-timestep game loop with requestAnimationFrame and delta time, so speed is the same on 60Hz and 144Hz screens.
- Screens: title, playing, paused (P or Esc), game over with score and "press R to restart".
- Difficulty ramps over time. Save the high score in localStorage.
- Scale the canvas to the window and keep the aspect ratio. Support touch controls if the game works on mobile.
- Juice: screen shake on hits, particles, a short hit-pause, and smooth camera or easing where it fits.
- Keep the code organized in sections: config, input, entities, update, render, audio, UI.

Before the code, write a 5-line game design summary (core loop, win/lose, controls, scoring, difficulty). Then output the full file in one code block with no placeholders or "TODO" left in it. After the code, list 3 ideas to make version 2 more fun.

How to use it

  1. Click Copy template.
  2. Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
  3. Replace the [BRACKETED] parts with your details.
Sponsor this page · Reach builders who use AI daily. Get details

FAQ

Which AI is best for one-prompt games?

Claude, ChatGPT, and Grok can all do it. Run the same prompt in two models and keep the better build, then iterate with follow-up prompts.

How do I play the result?

Save the code as index.html and double-click it, or paste it into CodePen, Replit, or a Cursor project and open it in your browser.

Can I publish the game?

Yes. Upload the single HTML file to itch.io, GitHub Pages, or Cloudflare Pages for free.

Get 3 new templates every week

Free. Unsubscribe anytime.

Related templates

Game Mod Idea & Plan Prompt

Brainstorm a mod and get a step-by-step plan to build it.

One-Page Game Design Doc Prompt

Turn a game idea into a tight one-page design doc.

NPC Dialogue & Personality Prompt

Generate an NPC with a consistent voice and branching dialogue.

Browse all Gaming templates

New on PromptLoot

AGENTS.md Starter Template for Claude Code, Codex & Cursor

A drop-in AGENTS.md (or CLAUDE.md) that tells coding agents how your repo works, how to verify changes, and what never to touch.

Strict JSON-Only Output Prompt (No Prose, No Code Fences)

Make ChatGPT, Claude, Grok, or any agent return valid JSON that matches your schema, with no chatty preamble or markdown fences.
PromptLoot Pro Pack · 200+ advanced templates, agent workflows, and Cursor rules bundles. Coming soon