A Pygame-based asteroid shooter game built as a learning project. The player controls a ship to destroy asteroids while managing lives and score.
✅ Completed:
- Basic Pygame window, game loop, and clock implemented in
main.py Playersprite with rotation and movement (WASD controls) inplayer.pyCircleShapebase class for physics-based objects incircleshape.pyAsteroidsprite that moves with velocity inasteroid.pyAsteroidFieldspawner that generates asteroids periodically inasteroidfield.pyShotprojectile class with velocity inshot.py- Sprite groups for organizing and updating game objects
- Debug logging system in
logger.py - Constants configuration in
constants.py
- Missing imports:
AsteroidFieldandAsteroidnot imported inmain.py asteroid.pyhas incorrect random import (should befrom random import uniformorimport random)Shotclass needsvelocityinitialization in__init__- Collision detection not yet implemented
- Game state management (win/loss conditions) not implemented
- Asteroid splitting logic incomplete in
split()method - Player shooting not wired to game loop
- Fix imports and initialize missing attributes
- Implement collision detection (player/asteroid, shot/asteroid)
- Wire up player shooting (space key) to game loop
- Complete asteroid splitting logic on collision
- Add game over and win conditions
- Add a scoring system
- Implement multiple lives and respawning
- Add an explosion effect for the asteroids
- Add acceleration to the player movement
- Make the objects wrap around the screen instead of disappearing
- Add a background image
- Create different weapon types
- Make the asteroids lumpy instead of perfectly round
- Make the ship have a triangular hit box instead of a circular one
- Add a shield power-up
- Add a speed power-up
- Add bombs that can be dropped
- Python 3.8+
- Pygame
- UV (package manager)
# Activate virtual environment
source .venv/bin/activate
# Install dependencies (if needed)
uv pip install pygameuv run main.py- A – Rotate left
- D – Rotate right
- W – Move forward
- S – Move backward
- Space – Shoot (not yet implemented)
├── main.py # Game loop and initialization
├── player.py # Player ship sprite and controls
├── asteroid.py # Asteroid sprite and splitting logic
├── asteroidfield.py # Asteroid spawner
├── shot.py # Projectile sprite
├── circleshape.py # Base class for physics objects
├── constants.py # Game configuration (screen size, speeds, etc.)
├── logger.py # Debug logging system
├── pyproject.toml # Project metadata and dependencies
└── README.md # This file
- Uses Pygame sprite groups for efficient updating and rendering
CircleShapeprovides position, velocity, and collision radius base functionality- All sprites are automatically added to groups using the
containersclass attribute pattern