This is a 2D game demo built from scratch with SDL2, without any game engine!
Clone this repository using command git clone https://github.com/Dont-laugh/SDL-Game.git
. Then open your terminal and browse to the folder of the cloned repository.
This project uses XMake to build automatically. Therefore you have to install XMake first. Here is the link to XMake's official documentation: Installation - xmake
Go to website: Releases - xmake.io. Just download xmake-master.win64.exe is OK.
On Mac OS, you can install XMake with homebrew conveniently:
brew install xmake
Now you are able to generate project files (e.g. *.sln, *.xcworkspace) to open project with your IDE.
Double click the batch file build_windows.bat. You will see like this:
Press y to allow XMake to install dependencies. Now you will find a new folder named like "vsxmake2022" (depends on your Visual Studio version), here locates sln and vcxproj files.
On Mac OS, you may encounter the following permission denied problem:
Run the chmod
command first of all is very helpful:
sudo chmod -R 777 ./
Afterwards, run file build_macos.sh at repository root directory:
./build_macos.sh
Similarly, type y
to allow downing dependency:
Now you will find
This method is as simple as running the following commands:
xmake build
xmake run