Skip to content

P0u4a/epic-space-shooter

Repository files navigation

Epic Space Shooter 👾

A two player space shooter, built entirely in C++, using SFML.

Game Controls

Accelerate Rotate Right Rotate Left Shoot Pause Game
Player 1 W A S D Escape
Player 2 Up Arrow Right Arrow Left Arrow Down Arrow Escape

Preview

Screenshot (28) Screenshot (27)

Building

Prerequisites

  • Install Conan with pip install conan. Mac users can also use brew install conan.
  • Install Cmake from here, ensuring Cmake is added to PATH. If you are using macOS, you can also install with brew install cmake.
  • Linting requires Python, clang-format, clang-tidy, and include-what-you-use to be installed and added to PATH.

Setting up Conan

If you haven't already, set up a Conan profile.

conan profile new default --detect

You might also need to set your conan profile to use the libcxx c++11 abi and to use the c++ 17 std:

conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update settings.cppstd=17 default

Installing dependencies

mkdir build
cd build
conan install .. --build=missing

If you're building for MacOS, you'll have to copy the .dylib files generated in build/bin over to /usr/local/lib.

Running the build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

Building for release will include a linting pass, which requires clang-format, clang-tidy, include-what-you-use, and Python to be available in PATH.

If you're building for MacOS, you'll have to add a couple of extra flags when building relevant to your system:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DMACOS=TRUE -DARM=TRUE

Where -DMACOS sets up CMake to build for Mac, and -DARM is needed if you're using Apple silicon.

Testing

To build tests, pass the -DTEST=1 flag to cmake:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTEST=1 ...
cmake --build build --config Release

Then to run the tests:

./build/bin/tests

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •