A version of the classic snake game written in C using Raylib.
  • C 98.7%
  • Shell 1.3%
Find a file
2026-07-10 13:10:18 +10:00
.gitignore Initial commit 2026-07-10 11:17:54 +10:00
build.sh Initial commit 2026-07-10 11:17:54 +10:00
main.c Add food after updating snake 2026-07-10 13:10:18 +10:00
preview.png Initial commit 2026-07-10 11:17:54 +10:00
ReadMe.md Initial commit 2026-07-10 11:17:54 +10:00
UNLICENSE Initial commit 2026-07-10 11:17:54 +10:00

Snake

A version of the classic Snake game written in C using Raylib.

Preview

Dependencies

Make sure Raylib is installed. For example, on Arch:

sudo pacman -S raylib

Build

To compile the code:

./build.sh

Run

To run the game:

./snake

Use the arrow keys to direct the snake toward the randomly placed food. The snake moves progressively faster after eating. The goal is to eat as much food as possible without running into a wall or yourself!

The game implements a small key input buffer to ensure rapid changes of direction are not discarded.

The game score dynamically moves to avoid overlapping with food or the head of the snake.