Welcome to the Space Invaders Clone, a classic arcade-style game recreated using Python and Pygame. Engage in an intergalactic battle by controlling your spaceship, dodging enemy attacks, and shooting down waves of enemies to achieve the highest score!
- Classic Gameplay: Experience the nostalgia of the original Space Invaders with modern enhancements.
- Multiple Enemies: Face off against multiple enemies that increase in speed and number as your score rises.
- Sound Effects: Enjoy engaging sound effects for background music, shooting, and explosions.
- Score Tracking: Keep track of your score and aim for high scores.
- Game Over Screen: Receive a game over message when enemies breach your defenses.
Follow these instructions to set up and run the game on your local machine.
- Python 3.6+: Ensure you have Python installed. You can download it from python.org.
- Pygame Library: This game uses Pygame for graphics and sound.
-
Clone the Repository
git clone https://github.com/yourusername/space-invaders-clone.git
-
Navigate to the Project Directory
cd space-invaders-clone
-
Create a Virtual Environment (Optional but Recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the Required Dependencies
pip install -r requirements.txt
If you don't have a
requirements.txt
, you can install Pygame directly:pip install pygame
-
Ensure Assets Are in Place
Make sure the following assets are present in the project directory:
bg.png
: Background image.monster.png
: Enemy and icon image.space-invaders (1).png
: Player spaceship image.bullet.png
: Bullet image.background.wav
: Background music.laser.wav
: Sound effect for shooting.explosion.wav
: Sound effect for explosions.Crashed Scoreboard.ttf
: Font file for score and game over text.
-
Start the Game
Run the Python script to start the game:
python space_invaders.py
-
Gameplay
- Control your spaceship to move left and right across the bottom of the screen.
- Press the Spacebar (or designated key) to shoot bullets at incoming enemies.
- Prevent enemies from reaching the bottom of the screen.
- Each enemy destroyed increases your score.
- The game ends when an enemy breaches your defenses.
-
Objective
Achieve the highest score possible by destroying as many enemies as you can before the game ends.
- Move Left: Press the Left Arrow key or 'A'.
- Move Right: Press the Right Arrow key or 'D'.
- Shoot Bullet: Press the Spacebar or 'S'.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
-
Fork the Repository
-
Create a New Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your feature"
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
Describe your changes and submit a pull request for review.
This project is licensed under the MIT License.
- Pygame: For providing the library that makes game development accessible in Python.
- Original Space Invaders: For inspiring this classic game remake.