A classic arcade-style space shooter built with Pygame, where you control a spaceship, shoot enemy ships, and survive as long as possible.
- Player Controls: Move left, right, up, and down using WASD keys and shoot with SPACEBAR.
- Enemy Waves: Enemies spawn in increasing numbers as you level up.
- Lasers & Collisions: Shoot lasers to destroy enemy ships while dodging enemy fire.
- Health & Lives System: Lose health when hit by enemies; lose lives if enemies pass through.
- Game Over Screen: Displays a "You Lost" message when all lives are gone.
- Main Menu: Click the mouse to start the game.
Make sure you have Python installed. Then, install Pygame:
pip install pygame
git clone https://github.com/yourusername/space-shooter.git
cd space-shooter
python main.py
Key | Action |
---|---|
W |
Move Up |
A |
Move Left |
S |
Move Down |
D |
Move Right |
SPACE |
Shoot Laser |
Mouse Click |
Start Game |
- Enemies spawn in waves, increasing as the player progresses.
- Each enemy randomly shoots lasers at the player.
- If an enemy collides with the player or reaches the bottom, the player loses health/lives.
- The player and enemies shoot lasers.
- Lasers disappear after going off-screen or hitting a target.
- Cool-down system prevents continuous shooting spam.
- The player starts with 5 lives.
- Health decreases when hit by enemies.
- The game ends when all lives are lost.