Guided project
Asteroids in Python
A clone of the classic arcade game built with Python and Pygame, applying object-oriented programming.
- Python
- Pygame
- OOP
What it is
A version of the classic Asteroids: a ship that moves and shoots, and asteroids that break into smaller pieces each time they’re hit. I built it as a guided project from the Boot.dev course.
What I learned
- Object-oriented programming for real: modeling the ship, the asteroids, and the shots as classes, each with its own state and behavior.
- The “game loop”: updating positions, detecting collisions, and drawing the scene many times per second.
- Using sprite groups in Pygame to manage many objects at once without losing control of the code.
- Collision detection and vector math for movement.
Why I include it
Even though it came from a course, it was the project where object-oriented programming really “clicked” for me: going from understanding the theory to seeing, in something that works, why it’s worth splitting a program into objects that collaborate with each other.