A simple Snake game implemented in C using SDL2.
This project showcases a Snake game developed using the SDL2 library in C. The game revolves around a growing snake that feasts on apples while evading collisions with itself. Additionally, when encountering the window boundaries, the snake reappears on the opposite side of the screen.
- Classic Snake gameplay
- SDL2 for graphics and input handling
- Collision detection
- Menu functionality
- C compiler (GCC recommended) with MinGW for Windows
- SDL2 library installed
-
Clone the repository:
git clone https://github.com/HuzPro/SnakeGame.git
-
Download the additional files from this link and place them in the same directory as the cloned repository files.
-
Compile the game:
gcc -std=c99 main.c -I SDL2 -L lib -Wall -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -mwindows -o main.exe
Run the compiled executable to start the game:
.\main.exe
Use arrow keys to control the snake and mouse to navigate the menu.
- Arrow keys: Move the snake
- Escape key: Open/close menu
- Arrow keys: Move the snake
- Escape key: Open/close menu
-
SDL2 Library: Thanks to the creators and maintainers of SDL2 for providing the graphics and input handling library.
-
Sherry: Special thanks to Sherry for their collaboration on various aspects of the game's development.
-
Documentation: Gratitude to SDL2 documentation for their informative resources, great tutorials and libraries that aided in understanding game development using SDL2.
This project was a collaborative effort between Huz and Sherry. Both contributors worked together to develop and refine various aspects of the game, including gameplay, graphics, and functionality.
Feel free to add more details or specify each person's contributions if needed.
This README.md
provides an introductory overview, installation instructions, usage details, controls and collaboration details.