This Snake game is a classic arcade game implemented in C using the SDL library. The player controls a snake, guiding it to eat food while avoiding collisions with the game area boundaries and itself. Each time the snake eats food, it grows in length. The game continues until the snake collides with the boundary or itself.
- Smooth snake movement.
- Random food generation.
- Adjustable game speed.
- SDL2 library
- C compiler (e.g., GCC)
- Make
-
Clone the Repository
git clone git@github.com:harrydobbs/snake_c.git cd snake_c
-
Build the Game
make all
This command will compile the source files and link them with the SDL2 library.
-
Run the Game
./build/snake_game
- Arrow Keys: Use the arrow keys to change the direction of the snake (Up, Down, Left, Right).
The game can be customized by modifying the parameters.h
file which includes settings such as screen width, screen height, and snake speed.
This project is licensed under the unlicense.