Horda

  • Difficulty: Hard
  • Action
  • Co-op
  • Online
Click inside the game to use the keyboard. Open in a new tab

How to play

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

WASD and mouse
move and aim (player 1)
Arrow keys and nearby keys
move and shoot (player 2)
Two on-screen sticks
move and aim on mobile

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 wave shooter for the browser, co-op for 1 or 2, with original art and a top-down camera.

- A closed map. "Shadows" come in from the corners: dark creatures with glowing eyes that dissolve into smoke when they die and leave a stain on the floor.
- Three types: the regular one, the fast and fragile one, and the slow, tough brute. Each wave brings more of them, and faster.
- Between waves, 10 seconds to move and spend the points from kills.
- Four weapons: pistol with infinite ammo, shotgun, SMG and grenade launcher; the last three with ammo you buy.
- Explosive barrels that can hurt me too, and barricades I can place.
- Camera from above, with a flat floor and height drawn as a top face plus a side. A big score with leading zeros and, above each player, their weapon, ammo and a health bar.
- Modes: single player; two on the same keyboard; and online with a 4-character room code.
Technical: a single HTML file with the CSS and JavaScript inside, no libraries and no external images, everything drawn on canvas. The simulation advances in fixed steps, separate from drawing. Playable with a finger on a phone and with keyboard and mouse on a computer.

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 isométrico 2D por oleadas, cooperativo para 1 o 2 jugadores, con arte y nombre originales.

Está inspirado en los shooters donde uno aguanta hordas en un mapa cerrado, con armas que se desbloquean y barriles explosivos. No copies nada de ningún juego existente: ni nombre, ni personajes, ni sprites. El juego se llama Horda y los enemigos son sombras: criaturas oscuras de diseño propio, con ojos brillantes, que se deshacen en humo al morir.

El juego:
- Vista cenital con ligera perspectiva, mapa cerrado con muros, cajas y pasillos.
- Se mueve en 8 direcciones y se dispara apuntando con el mouse (PC) o con una segunda palanca táctil (celular).
- Oleadas: cada una trae más sombras y más rápidas. Entre oleadas hay 10 segundos para moverse y comprar. Tres tipos de enemigo: la común, una rápida y débil, y una lenta y dura.
- Armas: pistola infinita, escopeta, subfusil y lanzagranadas. Munición limitada salvo la pistola.
- Barriles explosivos que el jugador puede detonar disparándoles, con daño en área que también hiere a los jugadores: eso es lo que hace divertido el caos.
- Barricadas que se colocan entre oleadas para cortar el paso, con vida limitada.
- Puntos por baja; entre oleadas se gastan en munición, armas y barricadas.
- Récord de oleada máxima alcanzada.

Modos: un jugador; dos jugadores en el mismo teclado (jugador 1 con WASD y mouse, jugador 2 con flechas y teclas cercanas); y dos jugadores en línea con código de 4 caracteres.

La red: el anfitrión simula enemigos, daño y puntaje; el invitado le envía sus entradas y dibuja lo que recibe, con interpolación. Paso de simulación fijo con acumulador, separado del dibujo. A 20-30 envíos por segundo, manda solo lo que cambió.

Pruebas que tienes que correr: colisiones contra muros a máxima velocidad, daño en área de los barriles incluido el daño a los jugadores, la máquina de oleadas y la economía de puntos; que el juego siga a 60 cuadros por segundo con 40 enemigos en pantalla; y que los dos jugadores puedan usar el mismo teclado con varias teclas apretadas a la vez.

Técnico: un solo archivo HTML con todo el CSS y el JavaScript dentro, sin librerías, sin CDN y sin imágenes externas, todo dibujado en canvas. Tiene que funcionar dentro de un iframe con sandbox="allow-scripts".

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.

  • Say FROM THE START what the camera looks like (top-down, isometric, side view): changing it later means redrawing everything, controls included.
  • If there will be real-time multiplayer, ask the game to keep simulation, input and drawing separate from day one. Adding it later took a whole adapter.
  • Ask for stains and effects that pile up to be painted once onto a separate canvas: that's what decides whether the game holds 300 stains at 60 frames per second.

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

  • Cámbiale la cámara a cenital con un poco de perspectiva, con el suelo recto y la altura dibujada como cara superior más costado, y que las manchas se queden en el piso.
  • Agrégale multijugador en línea de verdad, con código de sala, que el anfitrión simule y el invitado mande sus entradas, con el ping en pantalla.

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