A simple sandbox game using C and SDL2, includes two paddles and bouncing ball, endlessly bouncing.
The left paddle moves up (A Key) and down (D Key) as well as the right paddle, up (Left Key) and down (Right Key).
-
Create a CMakeLists.txt file in the root directory
-
Copy the contents of /cmake_example/CMakeLists.example.txt into the CMakeLists.txt file
-
update the CMakeLists.txt to include the path to your sdl2 installation
setup on mac or linux
- Create a build folder
mkdir build
- change your directory into the build folder
cd build
- This project uses cmake to build the game
cmake ..
add the -DCMAKE_EXPORT_COMPILE_COMMANDS=1 option to generate compile_commands.json file
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
- Use the make command
make
- Run the executable
./basic_arcade