Skip to content

AlyZakaria/space-rocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

space-rocket

Game Rules

  1. In each gameplay, 25 asteroids are generated at random X positions and begin falling towards the space rocket.
  2. Each asteroid is assigned a random color (red, green, or blue).
  3. The user should be able to move the space rocket using the mouse without dragging.
  4. 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".
  5. The user can destroy asteroids by aligning the laser beam with the asteroid and selecting the same color as the asteroid.
  6. When an asteroid is successfully destroyed, the score increases by one point.
  7. There is a time limit of 20 seconds, after which the [Time's Up] screen is displayed with the user's final score.
  8. 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

Installation

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:

Windows

  1. Download and install VisualStudio, which includes the necessary OpenGL libraries and tools.
  2. Install a C++ compiler.
  3. Clone the repository to your local machine.
  4. Compile the source code using the provided makefile or Visual Studio project file.
  5. Run the game executable file.

macOS

  1. Install Xcode.
  2. Install a C++ compiler, such as Clang.
  3. Clone the repository to your local machine.
  4. Compile the source code using the provided makefile or Xcode project file.
  5. Run the game executable file.

Linux

  1. Install the necessary OpenGL libraries and tools using your package manager(e.g., apt-get, yum, pacman).
  2. Install a C++ compiler, such as GCC.
  3. Clone the repository to your local machine.
  4. Compile the source code using the provided makefile.
  5. Run the game executable file.

How to Play

  1. Move the space rocket using the mouse without dragging.
  2. Shoot the laser beam by pressing the spacebar and change the color of the beam by pressing the spacebar again.
  3. Destroy the asteroids by aligning the laser beam with the asteroid and selecting the same color as the asteroid.
  4. The game ends after 20 seconds, and the final score is displayed on the "Time's Up" screen.
  5. Press F1 to restart the game.

Contributing

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.

Releases

No releases published

Packages

No packages published