Simple 2D snake game clone written in C99 using the capabilities of SDL3. Made for the purpose of studying game development.
Used libraries:
Game is available on two platforms, Linux and Windows.
Currently only fixed resolution is available.
All game artwork is made by me.
Font - Kongtext.
Required packages for self-build:
- build-essential
- libfreetype6-dev
- libsdl2-dev
Install required packages
sudo apt install build-essential libfreetype6-dev libsdl2-dev
Clone repo form github
git clone https://github.com/necromyhan/snake-game
Choose project directory
cd snake-game
Init and update git submodules
git submodule init
git submodule update
Configure CMake
cmake -B build
Build project
cmake --build build
Tested on Ubuntu 23.10.1 64-bit with gcc
Same as Linux, but before the cmake step download FreeType sources and copy them into ..\snake-game\sdl\SDL_ttf\external\freetype directory.
Tested on Windows 10 22H2 64-bit with MSVC
Ready-to-run game builds are available in the Releases section.
For Linux, self-build is recommended.
Launch run_game.sh script in the project directory. Ensure all files remain in their original locations.
cd snake-game
bash ./run_game.sh
Execute snake_game.exe. Ensure all files remain in their original locations.
- Arrow Keys: Navigate the snake or menu options.
- Enter Key: Select menu items.
Contributions are welcome! If you have ideas for improvements or bug fixes, feel free to fork the repository and submit pull requests.