This is the project that turned programming from an exercise into an obsession. I used p5.js because it made the draw loop and the canvas trivial, which meant every problem left over was a real one. How does a ship rotate and thrust and keep its momentum? How do you wrap objects around the screen edges without them popping? How do you check collisions between irregular shapes cheaply enough to do it every frame?
The core is classic Asteroids: ship physics from vector math (heading, acceleration, friction), asteroids that split into smaller fragments when you hit them, and a screen that wraps around on itself. The power-ups are where I went past the original. Each drop has its own effect, spawn logic, pickup detection, timed duration, and UI feedback, and together they touched the ship, the bullets, the HUD, and the spawner all at once. My one-giant-sketch-file approach collapsed under that, and refactoring into Ship, Asteroid, Bullet and PowerUp classes was my first real lesson in why structure exists.
The bugs were formative too. Circle-based collision that felt unfair on long asteroids. Movement tied to frame rate, from before I understood delta time. Power-up timers leaking across lives. None of it is elegant by my standards now, which is exactly why it stays in the portfolio. It’s the baseline I measure everything else against.
