A classic arcade-style asteroids game built with Python and the Pygame library. This project was developed as part of the Boot.dev curriculum, focusing on object-oriented programming, game loop mechanics, and vector math.
- OOP Design: All game entities (Player, Asteroid, Shot) are encapsulated classes.
- Game Loop Management: Uses Pygame's
sprite.Groupto efficiently update and draw all objects. - Physics: Player rotation, thrust, and bullet velocity are all delta-time-independent for smooth, consistent performance.
- Collision Detection: Accurate circle-based collision detection.
- Asteroid Splitting: Large asteroids split into two medium asteroids, and medium into two small, faster asteroids.
- Scoring System: A skill-based scoring system that rewards more points for destroying smaller, harder-to-hit targets.
- Move Forward:
UP ARROW - Move Backward:
DOWN ARROW - Rotate Left:
LEFT ARROW - Rotate Right:
RIGHT ARROW - Shoot:
SPACEBAR
This project requires Python 3 and Pygame.
- Clone the repository:
git clone https://github.com/amitb-dev/pygame-asteroids.git
cd pygame-asteroids- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate(On Windows, use .venv\Scripts\activate)
- Install dependencies:
python3 -m pip install -r requirements.txt- Run the game:
python3 main.py- Python 3
- Pygame