Polvorín

  • Difficulty: Very hard
  • Shooter
  • Tactical
  • 3D
Click inside the game to use the keyboard. Open in a new tab

How to play

Round-based tactical shooter with a hand-made 3D engine: two objective sites, a long alley and an unforgiving mid. 1v1, 2v2 or 3v3 against bots.

WASD and mouse
move and look
Click
shoot · R reloads · Q switches weapon
Shift and Ctrl
run and crouch

The game runs isolated from the rest of the site. Your high score and settings are saved only in this browser.

How this game was made

This game came out of a single message to an AI. Below: a short prompt to copy and paste, how to get the game as one HTML file, the full prompt that was actually used, and what it was missing.

Ask for it like this

Copy this prompt, paste it into Claude or ChatGPT, and that's it. It's the short version: the minimum for the game to come out playable.

Make me a round-based first-person shooter for the browser, with its own 3D engine, no libraries.

- A desert town map with two objective sites, a mid that gives control, a long alley with a clear line of sight and short routes with corners. Symmetric in timings for both teams, and I want you to check that by measuring.
- Move with WASD, look with the mouse, run, crouch. Two weapons: pistol and rifle, with reloads, ammo and recoil. Aim gets worse while moving and better while crouched.
- Hitscan shooting, with double damage to the head.
- Bots at three levels that patrol, take cover and shoot with a human-like delay. They can only aim at what they would actually see: check line of sight on every decision.
- 90-second rounds, first to 5. Score, health and ammo on screen.
- A lobby to pick 1v1, 2v2 or 3v3, with both teams' slots; when the match starts, empty slots are filled with bots.
Technical: a single HTML file with the CSS and JavaScript inside, no libraries and no external images; the 3D engine in hand-written WebGL with textures generated in code. Fixed simulation step separate from drawing. It should also open and be playable on a phone, with two touch sticks.

Getting it as an HTML file

A game like this is a single file you open with a double click. These four steps are the same in any AI.

  1. 1. Ask for the whole file

    Add this line at the end of your prompt: Give me a single, complete HTML file, nothing cut out, ready to save as index.html and open in the browser. Without it, you often get the code in pieces.

  2. 2. Copy all of the code

    In Claude the game shows up on the side, already running, with a button to copy or download it. In ChatGPT, copy the whole code block: it has to start with <!DOCTYPE html> and end with </html>.

  3. 3. Save it as index.html

    Paste it into Notepad (Windows) or TextEdit in plain text mode (Mac) and save it as index.html. Watch out for .txt: if the file ends up as index.html.txt, it won't open as a page.

  4. 4. Double-click to open it

    It opens in your browser and it's ready to play, with nothing to install and no internet needed. To share it, upload it to any web host or send it by email: it's just one file.

If the game shows up blank, go back to the AI and paste the error from the browser console (right click → Inspect → Console). With that text it fixes it fast.

The full prompt, the one actually used

Longer and more specific: numbers, screens and style details. It's the one that produced exactly this game, unedited. Use it if you want to fine-tune the result.

Diego wrote it in Spanish and it stays in Spanish on purpose: it's the honest record of how the game was made, and a translation would be a prompt nobody used. Claude and ChatGPT understand it as is; add "Answer in English" if you want the game's text in English.

Construye un shooter en primera persona para navegador: motor 3D propio en WebGL (sin librerías), mapa, combate, bots y lobby.

El mapa se llama Polvorín: pueblo desértico de arena y adobe, con dos zonas objetivo en extremos opuestos con dos entradas cada una, un medio que conecta ambos lados y da control del mapa con cubierta a media altura, un pasillo largo con línea de visión franca y rutas cortas con esquinas. Cajones y muros a media altura para cubrirse agachado. Simétrico en tiempos: los dos equipos llegan al medio en el mismo tiempo, y eso se MIDE y se reporta, no se estima. Un extremo a otro en 12-16 segundos caminando. Geometría de cajas alineadas a los ejes.

El juego: vista en primera persona, WASD, mirar con mouse, agacharse, correr. Dos armas, pistola precisa y fusil rápido con retroceso, con recarga y munición limitada; la puntería empeora al moverse y mejora agachado y quieto. Disparo por trazo de rayo con daño por zona (cabeza x2). Rondas de 90 segundos, primero a 5, con 5 segundos entre rondas. Marcador, vida, munición y un hueco para el ping.

Los bots no tienen que ser brillantes, sí creíbles: patrullan hacia el objetivo, se cubren, disparan con retardo de reacción de 200 a 350 ms y dispersión, y ven SOLO lo que verían de verdad (comprobación de línea de visión, nada de disparar a través de paredes). Tres niveles de puntería.

El lobby: el anfitrión elige 1v1, 2v2 o 3v3 y recibe un código de 4 caracteres. Los puestos de los dos equipos (Escuadrón y Renegados) se ven, y quien entra puede cambiarse de equipo mientras no empiece. Al dar Empezar, los puestos vacíos se llenan con bots. Si alguien entra durante la partida, ocupa el puesto de un bot al inicio de la ronda siguiente.

Nada de marcas ajenas: mapa original, equipos propios, armas genéricas.

Técnico: un solo archivo HTML con todo el CSS y el JavaScript dentro, sin librerías, sin CDN y sin imágenes externas; texturas generadas por código. Paso de simulación fijo (1/64 s) con acumulador, separado del dibujo. Tiene que funcionar dentro de un iframe con sandbox. 60 cuadros por segundo en una laptop normal a 1280x720, medido. En celular, dos palancas táctiles.

For ChatGPT, add the line from step 1 at the end: it tends to hand over the code in pieces.

What this prompt was missing

What became clear once the game was finished. If you're making your own from this one, add these from the start: fixing things later costs another round.

  • Ask for the map to be symmetric in TIMINGS and to prove it by measuring, not by eye: that's what separates a competitive map from a pretty one.
  • Require bots to check line of sight on every decision. Without that rule, they usually shoot through walls and the game feels rigged.
  • Say from the start that it will run inside an iframe: mouse capture needs a special permission, and without it you have to look around by dragging with the right button.

What was asked after the first result, in Diego's own words (Spanish):

  • A diferencia de los demás, este juego no salió de un prompt corto: se le pasó una especificación larga con el mapa, el lobby, los bots y cómo se enchufa la red más adelante.

It works in any AI

Claude, ChatGPT, Gemini, Copilot: the prompt is the same and so is the method. What changes is where you see the result. Four things that hold in all of them:

  1. Ask for a single file

    "A single HTML file with everything inside, no libraries or CDN." That way the game works with a double click, with nothing to install, and you can upload it to any website.

  2. Ask it to tell you what it assumed

    End with: "before writing the code, tell me in 5 lines what you assumed". That's where the gaps in your prompt show up, while fixing them is still cheap.

  3. One fix per message

    Say what happens and what you expected. If you ask for three changes at once, one usually undoes another.

  4. Ask it to test, not to promise

    "Check that every level can be won and tell me how you checked." That's how the games on this page found their bugs before going live.

The 6 parts of a good prompt, with a template to copy

More games

Ajedrez

Full chess with the real rules: castling, en passant, promotion and draws. Against the computer, two players on one device, or online with a code.

  • Medium
  • Classic
  • Strategy
  • Online

Bola 8

8-ball pool with its own physics: spin, cushions and ball in hand. Against the computer, two players on one device, or online with a code.

  • Medium
  • Physics
  • Sports
  • Online

Kuru

Greedy worms in a night field: eat the seeds, grow long and make the others crash into you. Solo against bots or online with up to 6.

  • Medium
  • Action
  • Arcade
  • Online

Horda

Hold out against waves of shadows in a closed map. Four weapons, exploding barrels and barricades. Solo, two on one keyboard, or online.

  • Hard
  • Action
  • Co-op
  • Online