- In each gameplay, 25 asteroids are generated at random X positions and begin falling towards the space rocket.
- Each asteroid is assigned a random color (red, green, or blue).
- The user should be able to move the space rocket using the mouse without dragging.
- A colored laser beam (red, green, or blue) shoots out the rocket, and the user can change the color of the beam using the "Spacebar".
- The user can destroy asteroids by aligning the laser beam with the asteroid and selecting the same color as the asteroid.
- When an asteroid is successfully destroyed, the score increases by one point.
- There is a time limit of 20 seconds, after which the [Time's Up] screen is displayed with the user's final score.
- The user can press on F1 to restart the game.
Note that when the user restarts the game, the asteroids' X values are randomly generated once again.
Space_Rocket.mp4
To play the game, you will need to have OpenGL and a C++ compiler installed on your machine. You can follow these steps to install them on different operating systems:
- Download and install VisualStudio, which includes the necessary OpenGL libraries and tools.
- Install a C++ compiler.
- Clone the repository to your local machine.
- Compile the source code using the provided makefile or Visual Studio project file.
- Run the game executable file.
- Install Xcode.
- Install a C++ compiler, such as Clang.
- Clone the repository to your local machine.
- Compile the source code using the provided makefile or Xcode project file.
- Run the game executable file.
- Install the necessary OpenGL libraries and tools using your package manager(e.g., apt-get, yum, pacman).
- Install a C++ compiler, such as GCC.
- Clone the repository to your local machine.
- Compile the source code using the provided makefile.
- Run the game executable file.
- Move the space rocket using the mouse without dragging.
- Shoot the laser beam by pressing the spacebar and change the color of the beam by pressing the spacebar again.
- Destroy the asteroids by aligning the laser beam with the asteroid and selecting the same color as the asteroid.
- The game ends after 20 seconds, and the final score is displayed on the "Time's Up" screen.
- Press F1 to restart the game.
If you would like to contribute to this project, please feel free to submit a pull request. Before submitting a pull request, please make sure that your changes are in line with the project's scope and goals.