Skip to content

Spaceship ─ a stylized game focused on the game feel of speed and shooting

arkaht/cpp-spaceship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spaceship

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.

image

Dependencies

Project

  • C++20 compiler
  • OpenGL 3.3.0
  • CMake 3.11

Libraries

Features

  • 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.

Project Structure

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.

Build the project

This project is built using CMake 3.11, ensure you have already installed a compatible version.

Steps

  1. Create a folder anywhere for the installation, we'll name it spaceship. The reason for this is that the game's CMakeLists.txt will attempt to finds the engine's folder directly from its own parent folder, if you don't want that, look at the Troubleshooting section.
  2. Clone the engine's repository in spaceship/cpp-suprengine.
  3. Run command git submodule update --init in the engine's folder.
  4. Clone the game's repository (this one) in spaceship/cpp-spaceship.
  5. Run the game's CMakeLists.txt either by using CMake's command line interpreter, CMake's GUI or your favorite IDE.

Troubleshooting

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.txt by replacing suprengine_symlink_assets with suprengine_copy_assets

About

Spaceship ─ a stylized game focused on the game feel of speed and shooting

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •