A simple 2D game engine based on SDL 2.0 to teach core game elements.
To simplify development, the following libraries are included:
- SDL 2.0.9
- SDL_image 2.0.5
- SDL_mixer 2.0.4
- SDL_ttf 2.0.15
The project is configured to be developed on Windows, so it only includes Windows-specific SDL versions, however you should be able to build on Linux and Mac OS by getting appropriate SDL distributions.
To build, you will need:
- CMake 3.6+ (Download binary Windows win64-x64 ZIP)
- Visual Studio 2019
- Download this repository by clicking "Clone or download" -> Download zip.
- Extract the zip file and rename
xcube2d-master
toxcube
.
Open the command line (via Git Bash ("git for windows")):
cd xcube2d
mkdir build
cd build
// Note: if running on Uni machines, it's /c/Program\ Files/CMake/bin/cmake rather than just cmake
// Note: if running on own machine, check where you downloaded cmake to and point there
cmake .. -G "Visual Studio 16 2019"
After this, a ".sln" will be generated in build/
.
- Open the ".sln" file with Visual Studio 2019.
- Right click on MyGame in project explorer and select as startup project.
- Right click on MyGame again and select Properties.
- In the properties window, Linker -> System and change SubSystem to Console.
- Copy the
res/
directory to thebuild
directory.
You can now run the demo from Visual Studio via Local Windows Debugger.
Read the assignment brief!
You should only modify:
- MyEngineSystem.h
- MyEngineSystem.cpp
- MyGame.h
- MyGame.cpp