Welcome to the Space Invaders game implemented in C++ using the Raylib library! This classic arcade game features a spaceship, laser beams, alien spaceships, obstacles, a mystery ship, collision detection, scoring system, high score tracking, and sound effects.
- Spaceship controlled by arrow keys
- Laser beams shot from the spaceship to destroy aliens
- Alien spaceships with varying movement patterns
- Obstacles to add challenge to the gameplay
- Mystery ship appearing randomly for bonus points
- Collision detection between lasers, aliens, and the spaceship
- Game over when the user ship is hit three times
- Different scores for different types of aliens
- High score tracking and storage in a text file
- Sound effects to enhance the gaming experience
- Raylib library: Download and installation instructions
- Use the arrow keys to control the spaceship.
- Press the spacebar to shoot lasers at the aliens.
- Avoid getting hit by the aliens' lasers or colliding with them.
- Destroy as many aliens as possible to score points.
- Shoot the mystery ship for bonus points.
- The game ends when the user ship is hit three times.
The game loop consists of the following steps:
- Initialize the game window and resources.
- Load textures, sound effects, and set up the game environment.
- Handle user input to control the spaceship and shoot lasers.
- Update the positions of the spaceship, lasers, aliens, and obstacles.
- Check for collisions between game elements.
- Update the score and high score.
- Display the game elements and user interface.
- Repeat steps 3-7 until the game ends or the user quits.
- Save the high score to a text file for future reference.
- Cleanup and exit the game.
- Ensure you have the Raylib library installed.
- Clone this repository to your local machine.
- Navigate to the project directory.
- Compile the source files using a C++ compiler, linking with the Raylib library.
- Run the executable file generated after compilation.
Enjoy playing Space Invaders! If you encounter any issues or have suggestions for improvements, please feel free to contribute to the project. Thank you for playing!