A classic-style space shooter game built with C++ and SFML to practice object-oriented programming (OOP). Take control of a spaceship and defend against waves of enemies while trying to achieve the highest score possible.
Check the wiki for more details on the project structure and OOP principles used in this game.
- Player Controls: Control your spaceship using
W,A,S,Dkeys - GUI Elements:
- Score tracking
- Health bar
- Game over screen
- Combat System:
- Shoot bullets using the
spacebar - Enemy collision detection
- Combat scoring system
- Shoot bullets using the
- Enemy System:
- Continuous enemy spawning
- Different enemy speed and health
- Collision detection with player and bullets
- Boss:
- Special alien boss enemy with laser attack
- Randomized movement
The following guide is for setting up the project on macOS and Linux devices. (UNIX-like systems). Support for windows in coming soon.
- A Mac with Xcode installed (for Clang and C++17 support)
- Homebrew for package management
- A Linux distribution with a C++ compiler (GCC or Clang)
Open your terminal and run:
brew install cmake
sudo apt-get install cmakeOpen your terminal and run:
brew install sfml@2Note: On Intel Macs, Homebrew typically installs packages in /usr/local/Cellar, while on Apple Silicon Macs the default prefix is /opt/homebrew/Cellar.
To get the correct SFML path, you can run:
brew --prefix sfml@2If neccessary, update the CMakeLists.txt file to point to the correct SFML installation path.
sudo apt update
sudo apt-get install libsfml-dev- Clone this repository
git clone https://github.com/fernandodonea/Stardust-Defenders
cd Stardust-Defenders- Create a build directory and cofigure the project:
mkdir build
cd build
cmake ..- Build the project:
make- Navigate to the project root again:
cd ..To run the game, execute the following command in your terminal in the project root directory:
./StardustDefenders
