An action-packed space shooter game built with Pygame where you control a spaceship and must defeat waves of enemy ships while avoiding their attacks.
- Start Screen: Main menu with options to start the game or view tutorial
- Tutorial: Learn game controls and objectives
- Main Game: Fast-paced shooting action
- Victory/Game Over Screen: Shows final score with options to play again or return home
- Player Health System: 150 HP with visual health bar
- Scoring System: +1 point for each enemy destroyed
- Dynamic Combat:
- Player rapid-fire system (300ms cooldown)
- Enemy formation with 32 ships (4 rows × 8 columns)
- Enemies shoot every 10 seconds (randomized to prevent sync)
- Enemy ships patrol horizontally within their zones
- Customizable background
- Smooth animations
- Health bar with color feedback
- Score display
- Semi-transparent game over overlay
- Python 3.x
- Pygame library
- Ensure Python 3.x is installed on your system
- Install Pygame using pip:
pip install pygame
- Place the required game assets in the
Assets
folder:player.png
: Player spaceship spriteenemy.png
: Enemy spaceship spriteplayer-bullet.png
: Player's projectileenemy-bullet.png
: Enemy's projectilebackground.jpg
: Game background (optional)
- Launch the game:
python main.py
- From the start screen, choose:
- Start: Begin a new game
- Tutorial: View game instructions
- Left/Right Arrow Keys: Move ship horizontally
- Spacebar: Fire weapon
- Mouse: Navigate menus
- Destroy all 32 enemy ships to achieve victory
- Avoid enemy bullets to maintain health
- Achieve the highest score possible
- Destroy all enemy ships
- Maintain health above 0
- Health reaches 0
- Too many enemy ships reach the bottom
main.py
: Core game loop, state management, and UIplayer.py
: Player ship mechanics and bullet systemenemy.py
: Enemy AI, formation management, and attack patternsAssets/
: Game sprites and resources
The game is built with a modular structure for easy maintenance and expansion:
- Separate classes for Player, Enemy, and Bullet entities
- State-based game flow management
- Configurable game parameters for easy balancing
- Fallback sprites if image assets are missing
Built with Pygame - A free and open-source Python game development library.