This is a simple implementation of the classic Snake game using SFML (Simple and Fast Multimedia Library) in C++. In this game, the player controls a snake that moves around the screen, eating food to grow longer. The objective is to eat as much food as possible without colliding with the snake's own body.
- SFML
Make sure you have the following dependencies installed on your system:
- SFML
- GNU Make
- Clone this repository.
- Navigate to the root directory of the project.
- Run
make
in the terminal to compile the source code. - Once compilation is complete, execute the game by running
./snake_game
.
- Use the arrow keys to control the direction of the snake:
- Up arrow: Move the snake upwards
- Down arrow: Move the snake downwards
- Left arrow: Move the snake to the left
- Right arrow: Move the snake to the right
- Eat the food (displayed as icons) to grow the snake and increase your score.
- Avoid colliding with the snake's own body or the walls of the game area.
- The game ends when the snake collides with itself.
Enjoy playing Snake and have fun!