Asteroid Survival
A quick arcade game running right in the docs. Dodge the asteroids, survive as long as you can, and try to beat your high score.
Controls: Arrow keys / WASD to move. Click the game to focus it first.
How It Works
Same state-first pattern as the Pong demo:
- State — ship position/velocity, asteroid array, particle pool, score
- Update — physics (inertia + friction), spawning, circle collision detection
- Render — reads state and draws: twinkling starfield, neon ship with thrust trail, irregular polygon asteroids, explosion particles
Difficulty ramps over time — asteroids spawn faster and move quicker. The game stays fun because collision uses 80% of the asteroid radius, creating exciting near-misses.