A classic Space Invaders arcade game built with Python and Pygame. Defend your planet by shooting down enemies while avoiding their attacks!
- Features
- Installation
- How to Play
- Game Controls
- Screenshots
- Project Structure
- Requirements
- Contributing
- License
- Classic Gameplay: Experience the nostalgic arcade action of Space Invaders
- Sound Effects: Immersive audio with background music, laser sounds, and explosions
- Progressive Difficulty: Enemies become faster and more challenging as you advance
- High Score Tracking: Your best scores are saved and displayed
- Customizable Audio: Choose to enable or disable sound at startup
- Smooth Controls: Responsive keyboard controls for precise movement and shooting
- Resizable Window: Play in fullscreen or windowed mode
- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/yourusername/space-invaders.git cd space-invaders -
Install dependencies
pip install pygame
-
Run the game
python levelup.py
Or for the original version:
python main.py
- Launch the Game: Run
python levelup.pyto start playing - Audio Setup: When prompted, choose whether to enable sound (Y/N)
- Defeat Enemies: Shoot down all enemies before they reach the bottom of the screen
- Progress: The game becomes harder with each level—enemies move faster and there are more of them
- Game Over: The game ends when enemies reach your position
- High Score: Your best score is automatically saved and displayed
| Key | Action |
|---|---|
| ← Left Arrow | Move player left |
| → Right Arrow | Move player right |
| SPACE | Fire bullet |
| ESC/Close Window | Exit game |
Add screenshots here
space-invaders/
├── main.py # Original game version
├── levelup.py # Enhanced version with progression system
├── space_invaders_highscore.txt # High score storage
├── README.md # This file
├── assets/
│ ├── background.png # Game background image
│ ├── player.png # Player spaceship sprite
│ ├── enemy.png # Enemy sprite
│ ├── bullet.png # Bullet sprite
│ ├── ufo.png # Game icon
│ ├── background.wav # Background music
│ ├── laser.wav # Laser sound effect
│ └── explosion.wav # Explosion sound effect
└── tempCodeRunnerFile.py # Temporary file (can be deleted)
- pygame: Graphics and game development library
- Python Standard Library: math, random, os modules
See requirements.txt for exact versions:
pygame>=2.0.0
- Player: Navigate with arrow keys to avoid enemy fire and position yourself to shoot
- Enemies: Move across the screen and drop down periodically
- Bullets: Fire to destroy enemies and earn points
- Collision Detection: Uses distance-based collision to determine hits
- Scoring: Earn points for each enemy destroyed
- Levels: Game difficulty increases with progression
- Resizable window may affect sprite positioning on some systems
- Sound files are optional; game runs without audio if files are missing
- Multiple difficulty levels
- Power-ups and special weapons
- Enemy variety with different behaviors
- Leaderboard system
- Mobile/touchscreen support
- Customizable player color/ship
- Boss battles
Contributions are welcome! Please feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request .
- Inspired by the classic Atari arcade game "Space Invaders"
- Built with Pygame, a Python game development library
- Sound effects and graphics created for this project
For questions or suggestions, please open an issue on the GitHub repository.
Happy Gaming! 🚀