A classic Asteroids arcade game remake built with Python and Pygame.
Navigate your spaceship through an asteroid field, shooting asteroids to survive and rack up points. Asteroids split into smaller pieces when hit, creating an increasingly challenging gameplay experience.
- Classic asteroids gameplay mechanics
- Progressive difficulty as asteroids split
- Score tracking
- Smooth controls and physics
- Continuous asteroid spawning
- W - Move forward
- S - Move backward
- A - Rotate left
- D - Rotate right
- SPACE - Shoot
- Clone the repository:
git clone <your-repo-url>
cd pygame-asteroid- Create a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install pygameOr if using uv:
uv syncpython main.py- Python 3.12+
- Pygame 2.6.1
- Avoid colliding with asteroids - one hit and it's game over!
- Shoot asteroids to break them into smaller pieces
- Smaller asteroids are worth the same points but harder to hit
- See how high you can score!
main.py- Game loop and main logicplayer.py- Player spaceship classasteroid.py- Asteroid class and splitting behaviorshot.py- Bullet/projectile classcircleshape.py- Base class for circular game objectsasteroidfield.py- Asteroid spawning systemconstants.py- Game configuration and constants
The base of this project was built following the Build Asteroids with Python course from Boot.dev. Scoring system was additionally added.
This project is open source and available for educational purposes.