A classic arcade-style space shooter game built using Python and the Pygame library.
This project offers a chance to explore and contribute to a 2D game developed with Pygame.
Galaxy Invaders is a 2D space shooter where the player controls a spaceship to defend against waves of oncoming alien enemies. The game involves shooting, dodging, collecting power-ups, and managing health/lives. As an active development project, there might be bugs or areas where functionality deviates from the intended design.
- Move Left: Left Arrow Key
- Move Right: Right Arrow Key
- Shoot: Spacebar
- Your ship appears at the bottom of the screen.
- You start with 3 lives.
- Your ship has a shield (shown as a bar at the top left).
- When your shield is gone, you lose a life.
- When all lives are lost, the game should end automatically (It will exit the game and close the window automatically)
- Enemy ships come from the top and move down.
- They can also move sideways.
- If an enemy reaches the bottom or goes too far to the sides, it should reappear at the top.
- Shoot bullets to destroy enemies.
- Bullets go up from your ship.
- Bullets fly at a reasonable speed.
- At power level 1, you shoot one bullet.
- At power level 2 or higher, you shoot two bullets at once.
- Shield Power-up: Blue circle icon. Increases your shield by 20 (up to 100).
- Power Power-up: Yellow icon with a red pattern. Increases your power level.
- Power-ups disappear if they go off the bottom of the screen.
- Power level upgrades last for 5 seconds, then return to normal.
When you collect a power-up, you should see something like this on the screen:
If you don’t see the power-up effects or icons as shown, there may be something to improve!
- Destroying an enemy gives you 100 points.
- Your score is shown at the top center.
- Shield bar is at the top left.
- Lives left are shown as small ship icons at the top right.
- Python 3
- Pygame library
- Python 3 installed.
- pip (Python package installer) installed.
- Clone the repository and navigate to the project's root directory in your terminal.
- Install necessary Python packages (including Pygame):
pip install -r requirements.txt
- Important: Generate the game's image assets (sprites):
(Check IMAGE_GUIDE.md for a visual explanation of the sprites after running this command.)
python create_sprites.py
- Start the game:
python space_adventure.py
Help us improve Galaxy Invaders!
- Play the game thoroughly to identify behavior that doesn't match the feature descriptions or seems incorrect (e.g., issues with scoring, lives, shields, power-ups, enemy patterns, game state). Check GitHub Issues for known bugs.
- Debug and correct the Python code, primarily within
space_adventure.py
, to align the game with the intended mechanics. - Commit your fixes and submit them via Pull Requests (PRs) to the main repository.
- Focus on logical fixes. Ensure your code is readable and adheres to good practices. Avoid unnecessary structural changes that might disrupt existing functionality or tests.
(Note: Potential areas needing attention include calculation errors, condition logic, power-up effects, or game state transitions. Exploring the code and gameplay is the best way to find these.)
- Automated tests are configured to run against submitted Pull Requests.
- These tests simulate gameplay scenarios to verify that game mechanics work as expected after your fixes are applied.
- Passing the automated test suite is a requirement for merging contributions.
Thank you for playing and considering contributing to Galaxy Invaders!