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.
Make it yours. 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.
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.
“generated entirely in a single GPT-5 or GPT-5.2 prompt, without writing any code by hand”
- GPT-5.2
- One-shot
You'll need
- 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
How it was made
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.
GPT-5.2
Source and credit
GitHub · Dec 11, 2025 · 1.9k stars
Authorship not stated by the source
Published instructions: examples/asteroid-game-5.2.yaml in the repo, also shown on the hosted gallery
Look notesby Reference
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.






























