Space Wars is an arcade-style space shooter game built using Python and the Pygame library. Inspired by classic shoot-em-ups, the game features fast-paced action, enemy waves, and responsive controls. This project is a great example of 2D game development using Pygame.
Space Wars is a Python-based game where you control a spaceship to battle waves of incoming enemies. Built with Pygame, it demonstrates fundamental game development concepts such as collision detection, sprite handling, sound integration, and game loops.
- Smooth player movement with keyboard input
- Bullet shooting mechanics
- Collision detection between bullets and enemies
- Score tracking and game-over logic
- Sound effects and background music
- Clean and modular code structure
- Control your spaceship using the arrow keys
- Press the spacebar to fire bullets
- Destroy enemies to score points
- Avoid enemy collisions — one hit and it’s game over!
-
Clone the repository:
git clone https://github.com/Viriviola/space-wars.git cd space-wars -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the game:
python main.py
Make sure you have Python 3.x installed.
| Key | Action |
|---|---|
← |
Move left |
→ |
Move right |
Spacebar |
Fire bullet |
Esc |
Quit the game |
- Python 3.9
- Pygame 2.1
This project is licensed under the MIT License. See the LICENSE file for details.
- Pygame Documentation
- Classic arcade games that inspired the gameplay
- Open source sprite and sound assets