Spaceship is a stylized C++ 3D game about spaceship movement, asteroids and the game feel of speed.
It is built using suprengine, my custom engine which uses OpenGL and SDL2.
- C++20 compiler
- OpenGL 3.3.0
- CMake 3.11
- Stylized rendering with flat colors for outlines.
- Feedback for going at max speed such as with the camera and a thruster effect behind the spaceship.
- Shootable asteroids roaming on their own.
- Shoot with bullets and guided missiles, destroy spaceships or get destroyed and respawn.
- Pawn-Controller architecture for spaceships similar to Unreal Engine, allowing to separate code for Player and AIs.
This project only holds the engine code since it is de-coupled from games code.
Folder structure:
assets/contains game assets, such as models, textures, curves for explosion effects, etc.src/contains source files of the game.
This project is built using CMake 3.11, ensure you have already installed a compatible version.
- Create a folder anywhere for the installation, we'll name it
spaceship. The reason for this is that the game'sCMakeLists.txtwill attempt to finds the engine's folder directly from its own parent folder, if you don't want that, look at the Troubleshooting section. - Clone the engine's repository in
spaceship/cpp-suprengine. - Run command
git submodule update --initin the engine's folder. - Clone the game's repository (this one) in
spaceship/cpp-spaceship. - Run the game's
CMakeLists.txteither by using CMake's command line interpreter, CMake's GUI or your favorite IDE.
Change engine's folder location
If for some reasons you want to move the engine's or game's folder apart from each other,
you can configure the location of the engine using the CMake variable SUPRENGINE_PATH.
Using command line:
cd build
cmake .. -DSUPRENGINE_PATH=C:/Path/To/Engine/You can also use cmake-gui to change this variable.
Couldn't update engine's Git Submodules
If running the git submodule update command didn't work for any reasons, replace the folder libs/curve-x by cloning arkaht/cpp-curve-x.
Need administrator privileges to run the CMakeLists.txt
I'm using symbolic links to avoid having to copy the assets folder each time I compile. The problem is that on Windows, the symlink command requires administrator privileges. To resolve that, you can either:
- Enable Windows developper mode (not recommended).
- Run your IDE or CLI with administrator privileges.
- Edit the
CMakeLists.txtby replacingsuprengine_symlink_assetswithsuprengine_copy_assets
