A classic Asteroids clone built in Python with Pygame, following the Boot.dev curriculum.
Pilot a spaceship through an asteroid field and destroy incoming rocks before they destroy you. Large asteroids split into smaller, faster fragments when shot — clear them all to survive.
- Avoid asteroids — one hit ends the game
- Shoot asteroids to split them into smaller pieces
- Small asteroids are destroyed completely when shot
| Key | Action |
|---|---|
W |
Thrust forward |
S |
Thrust backward |
A |
Rotate left |
D |
Rotate right |
Space |
Shoot |
- Python 3.13+
- uv (recommended) or pip
With uv (recommended):
uv run main.pyWith pip:
pip install pygame==2.6.1
python main.py| File | Description |
|---|---|
main.py |
Game loop and entry point |
player.py |
Player ship movement and shooting |
asteroid.py |
Asteroid behavior and splitting logic |
asteroidfield.py |
Asteroid spawning logic |
shot.py |
Projectile behavior |
circleshape.py |
Base class for circular game objects |
constants.py |
Tunable game parameters |
logger.py |
Game event and state logging |