Example project from 'SDL Game Development' by Shaun Mitchell
This is an example project from 'SDL Game Development' by Shaun Mitchell, a book originally published back in 2013. The original source code for the book can now be found on Github here. If you are interested in learning more about SDL (Simple DirectMedia Layer) and making games, I highly recommend you buy this book.
I originally created this repo back in 2014 as I worked my way through the book. In December 2022, I decided I wanted to pick up C/C++ games development again, unfortunately breaking any forked version of this repo. I decided to revisit this project and see improve upon it as I write my own game engine throughout 2023. I plan to make a number of changes, including:
I've done the above already in another unlinked repo. I plan to merge those changes into this repo over the next few days.
In addition to the above:
I've included a Makefile that should work on most Linux systems, including Windows Subsystem for Linux and possibly for MacOS. You'll need to install SDL2 and the SDL2 image, ttf, and mixer extensions. To install these extensions on a Debian based system, you can follow these instructions. If you're on a different system, you'll need to install the SDL2 and extensions per the instructions for your system. If you already have SDL2 and extensions installed, only steps you need is to install Tiled, Valgrind, and Google Test if you don't have those already. On Debian-based systems, you can do the following:
sudo update && sudo apt install cmake llibtinyxml-dev tiled valgrind
BUILD_DIR=~/build-sdl2
mkdir -p $BUILDDIR && cd $_
git clone https://github.com/google/googletest cd $BUILDDIR/googletest
cd googletest && cmake .
make && sudo make install
rm -rf $BUILDDIR
I'll update these instructions for WSL and MacOS, eventually. However, if anyone wants to submit a PR for these, I'd be happy to accept it.
Just simply type make && make run
to build and run the game.