A Python implementation of the classic Space Invaders arcade game using Pygame.
-
Player Mechanics
- Move with arrow keys
- Shoot with spacebar
- Multiple lives system
- Power-up system with increased firepower
-
Enemy System
- Multiple waves of enemies
- Progressive difficulty
- Enemy shooting mechanics
- Random enemy attack patterns
-
Power-ups
- Collect yellow orbs for power-ups
- Three power levels:
- Level 1: Single shot
- Level 2: Double shot
- Level 3: Triple shot
- 10-second duration
- 10% spawn chance from destroyed enemies
-
Visual Effects
- Dynamic starfield background
- Twinkling stars with varying colors and sizes
- Player invincibility animation
- Score and lives display
- Wave counter
- Power level indicator
-
Audio System
- Background music
- Shooting sound effects
- Power-up collection sounds
- Game over sound
- Explosion sounds when enemies are destroyed
- Hit sounds when player takes damage
- Volume-balanced audio system
- Arrow Keys: Move player ship
- Spacebar: Shoot
- Up/Down: Move vertically (limited to lower half of screen)
- Left/Right: Move horizontally
- Python 3.x
- Pygame
- Clone the repository:
git clone git@github.com:toledo-labs/space_invaders.git
cd space-invaders- Install Pygame:
pip install pygame- Run the game:
python3 main.py- Destroy enemy ships to score points
- Each enemy destroyed gives 10 points
- Collect power-ups to increase firepower
- Avoid enemy bullets
- Game ends when player loses all lives
- New wave starts when all enemies are destroyed
- Difficulty increases with each wave
space-invaders/
├── main.py # Main game loop and initialization
├── assets/ # Game assets
│ ├── player_ship.png
│ ├── enemy_ship.png
│ ├── background.wav
│ ├── shoot.wav
│ ├── powerup.wav
│ ├── game_over.wav
│ ├── explosion.wav
│ └── hit.wav
└── entities/ # Game entities
├── player.py # Player ship logic
├── enemy.py # Enemy ship logic
├── bullet.py # Projectile logic
└── powerup.py # Power-up system
This project is open source and available under the MIT License.