snake-game

Snake game remake using SDL3

Stars
5

Snake Game

About

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.

Gameplay screenshot

Build

Linux

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

Windows

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

Binary

Ready-to-run game builds are available in the Releases section. For Linux, self-build is recommended.

Running the Game

Linux

Launch run_game.sh script in the project directory. Ensure all files remain in their original locations.

cd snake-game
bash ./run_game.sh

Windows

Execute snake_game.exe. Ensure all files remain in their original locations.

Controls

  • Arrow Keys: Navigate the snake or menu options.
  • Enter Key: Select menu items.

Contributing

Contributions are welcome! If you have ideas for improvements or bug fixes, feel free to fork the repository and submit pull requests.