The arcade classic with glowing vector lines and an AI pilot.
A full game in the style of the 1979 vector arcade machine: a ship with inertia, wrap-around space, asteroids that split when shot, flying saucers that shoot back, hyperspace and score. Every line is stroked three times with additive blending onto a screen that only partly fades between frames, imitating a glowing phosphor tube, and explosions throw out shards. Until you take over, an AI pilot leads its shots at the most dangerous target and dodges what is coming, with the occasional fatal lapse.
Try it. Click the view, then use the arrow keys to fly, space to shoot and down for hyperspace. On a touch screen, hold to steer toward your finger and fire. Leave it alone and the AI plays.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a playable Asteroids game in the style of the 1979 vector arcade machine with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Paint it black.
- Draw everything as thin white outlines, never filled shapes: the ship is a five-point arrowhead, and each asteroid is a jagged polygon made by placing 8 to 11 points around a circle at random radii.
- Give the ship inertia: the left and right arrows rotate it, up thrusts along its heading, and a little drag slows it down. Space fires bullets that inherit the ship's velocity and expire after about a second.
- Space wraps around: anything leaving one edge comes back on the opposite one. When an object straddles an edge, draw it a second time on the other side so it never pops.
- Shooting a large asteroid splits it into two medium ones, a medium into two small ones, and small ones are destroyed. Keep score and start a new wave when the screen is clear.
- For collisions, test each bullet against the rock outline with a point-in-polygon check, measuring distances the short way around the wrapped screen.
Once that works, make it beautiful:
- Fake a phosphor screen: stroke every line three times with additive blending ("lighter"), first wide and faint, then medium, then thin and bright.
- Do not fully clear the canvas each frame; fade it toward black so moving lines leave a short glow.
- Add a flickering thrust flame, flying debris when things explode, and a little screen shake.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as flying saucers that shoot back, a hyperspace button, or an AI pilot that plays when nobody is at the keyboard.