A 2-player competitive shooting game built with Python and Pygame. Battle it out in space as Red and Yellow spaceships and blast your opponent with bullets to victory!
Space Ship Battle is a local 2-player game where each player controls a spaceship on opposite sides of the screen. Players must move and shoot bullets to reduce the opponent's health. The game includes sound effects, health tracking, and a win screen.
- ๐ฎ Local multiplayer spaceship combat
- ๐ฅ Bullet collision effects with sound
- ๐ก๏ธ Health bars and win conditions
- ๐จ Space-themed background and ship sprites
- ๐ Background music and SFX support
Make sure you have Python 3 installed,
python --versionThen:
# Clone the repository
git clone https://github.com/yourusername/space-ship-battle.git
# Navigate to the project directory
cd space-ship-battle
# Install dependencies
pip install pygameTo run the game:
python spaceship.py-
Yellow Player
- Move:
WASD - Fire:
Left Ctrl
- Move:
-
Red Player
- Move:
Arrow Keys - Fire:
Right Ctrl
- Move:
You can tweak gameplay variables in the script:
VEL = 5 # Player movement speed
BULLET_VEL = 7 # Bullet speed
MAX_BULLETS = 10 # Max bullets on screen
SPACESHIP_WIDTH, SPACESHIP_HEIGHT = 55, 40Make sure the Assets/ folder contains the following:
spaceship_red.pngspaceship_yellow.pngspace.png(background)Gun+Silencer.mp3(firing sound)Grenade+1.mp3(hit sound)
All assets should be placed inside an Assets directory relative to the script.
- Fork the repo
- Create your 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