A simple 2D space shooter built with Python + Pygame. Control your ship, shoot asteroids, and survive as long as possible.
git clone <your-repo-url>
cd <your-folder>Using uv:
uv syncOr using pip:
pip install pygamepython main.py| Key | Action |
|---|---|
| W | Move forward |
| S | Move backward |
| A | Rotate left |
| D | Rotate right |
| SPACE | Shoot |
| Close Window | Exit game |
- You control a spaceship in open space.
- Asteroids spawn from the edges and move across the screen.
- Shoot asteroids to destroy them.
- Large asteroids split into smaller ones.
- If your ship collides with an asteroid → Game Over.
- Smooth movement using delta time (
dt) - Shooting system with cooldown
- Asteroid spawning and splitting
- Collision detection
- Event logging system
- Reinforcement learning training code included
- Trained model files available in
models/
.
├── main.py
├── player.py
├── asteroid.py
├── asteroidfield.py
├── shot.py
├── circleshape.py
├── constants.py
├── logger.py
- Score system
- Sound effects
- Screen wrapping
- Particle effects
- Enemy AI
Built as part of a learning project for game development using Pygame.