# Asteroids dogfight against AI ships

> Nebula Drifter, a 2D space shooter: fly a ship, blast asteroids, and dogfight computer-controlled pirate ships, with hull, shield, and energy bars. One of OpenAI's GPT-5.2 coding examples, made from a single zero-shot prompt.

- Kind: Game
- Live game: https://gpt5-coding-examples.vercel.app/asteroid-game-5.2
- Page: https://meetreference.com/v/asteroids-dogfight-against-ai-ships/
- Ready-to-use agent handoff: https://meetreference.com/v/asteroids-dogfight-against-ai-ships/agent.txt
- Exact prompt as plain text: https://meetreference.com/v/asteroids-dogfight-against-ai-ships/prompt.txt
- Authorship: Not stated
- Made with: Not stated
- Model: GPT-5.2
- Built with: not stated
- Style: Games; space shooter, arcade, asteroids, 2d, dogfight, neon
- Shared by OpenAI in GitHub, Dec 11, 2025: https://github.com/openai/gpt-5-coding-examples/blob/main/examples/asteroid-game-5.2.yaml
- Prompt fidelity: Verbatim. This is the complete prompt exactly as the creator published it.

## Before you start

Guidance from Reference, separate from the creator's instructions.

1. Read the reference and inspect the project, installed libraries, and available agent skills before writing code. Reuse suitable tools already present.
2. Prefer the creator-reported libraries and skills when they fit the task. Explain what useful additions help with, and install missing project dependencies or relevant skills from official sources when the environment and the user's existing permissions allow it. Respect the project's package manager and setup rules; do not ask again for routine setup already authorized.
3. Distinguish tools used by the creator from your own recommendations. A listed tool is not automatically required, and an empty tools or requirements list means the setup is unknown, not that nothing is needed.
4. Ask concise questions when missing inputs or choices materially affect the result: paid services, credentials, the user's assets, or a different production approach. Use existing answers and permissions; continue independent work while waiting.
5. If a useful library, skill, or service cannot be installed or used, explain an available alternative and its expected effect on quality, features, or effort. Get the user's choice before a material compromise; otherwise state the fallback and continue. Never silently simplify the result or claim to have used a tool you did not use.

Requirements reported by the source: A Next.js app made with create-next-app to paste the page.tsx into, or drop the last sentence and ask for one HTML file.

## Recreating this game

These are the creator's published instructions, unedited.

To adapt it: Change "2d space game" and "dogfight with other computer-controlled AI" to your own genre and opponents, and keep "Be creative with the design of the ships. Ensure the gameplay works and is fun." Replace the sentence starting "Output code in a single next.js page.tsx file" if you don't use Next.js.

## Prompt

```text
Make a 2d space game, in which I can fly a ship, avoid and blow up asteroids, and dogfight with other computer-controlled AI. Be creative with the design of the ships. Ensure the gameplay works and is fun.
Output code in a single next.js page.tsx file, which can be pasted directly into a next.js app created by create-next-app, alongside any context or instructions needed to run it.
```

## What it looks like

Written by Reference from the recording frames, not by the creator.

A top-down space shooter on a dark navy field: a small cyan ship trades dotted fire with red-ringed pirate ships among outlined asteroids, after a menu of controls and intel.

- Color: Near-black navy with a soft blue haze in the middle, cyan and teal for the player's ship, shots, and asteroid outlines, red rings on the pirate ships, white debris bursts, and red, blue, and green status bars.
- Type: Small monospace HUD text: score, wave, lives, and kills over HULL, SHIELD, and ENERGY bars in the top left. The menu is titled NEBULA DRIFTER, with key caps for each control and INTEL notes on three pirate types; a banner reads "Practice mode: fewer enemies".
- Framing: 16:10, seen straight down. A faint lit rectangle fills the middle of the field; the ships are tiny against wide empty space, with grey polygon asteroids drifting around the edges.
- Structure: The menu with CONTROLS and INTEL panels, then practice mode: the ship drifts and fires at pirates, an asteroid bursts into white fragments, the shield bar drains, and the run restarts with the practice banner.

Storyboard, nine frames spread across the recording: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/storyboard.webp

- Frame 1 at 0.8s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f1.webp
- Frame 2 at 2.5s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f2.webp
- Frame 3 at 4.1s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f3.webp
- Frame 4 at 5.8s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f4.webp
- Frame 5 at 7.4s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f5.webp
- Frame 6 at 9.0s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f6.webp
- Frame 7 at 10.7s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f7.webp
- Frame 8 at 12.3s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f8.webp
- Frame 9 at 14.0s: https://meetreference.com/media/asteroids-dogfight-against-ai-ships/f9.webp

## How it was made, per the creator

- One-shot: yes, a single prompt with no follow-ups
- Notes: OpenAI's README says every demo in the collection was generated in a single GPT-5 or GPT-5.2 prompt with no code written by hand, and the gallery calls it the zero-shot prompt. The prompt asks for a Next.js page.tsx; the hosted GPT-5.2 build in the repo is a single HTML file. The gallery also has a GPT-5 version from the same prompt. Which coding tool ran it isn't stated.

> generated entirely in a single GPT-5 or GPT-5.2 prompt, without writing any code by hand
> (OpenAI)

## Links

- Play game: https://gpt5-coding-examples.vercel.app/asteroid-game-5.2
- Original post: https://github.com/openai/gpt-5-coding-examples/blob/main/examples/asteroid-game-5.2.yaml
- Code for every example: https://github.com/openai/gpt-5-coding-examples
- GPT-5 version from the same prompt: https://gpt5-coding-examples.vercel.app/asteroid-game
