This project is a simple implementation of the classic Snake game using the SFML library for graphics rendering. The game includes obstacles that randomly appear, adding an extra challenge.
- Operating System: Ubuntu (or any other system compatible with SFML)
- SFML Library: Ensure SFML is installed on your system.
- C++ Compiler: GCC or any other compiler compatible with C++11 or later.
-
Install SFML:
- On Ubuntu, you can install SFML using the following command:
sudo apt update sudo apt install libsfml-dev
- On Ubuntu, you can install SFML using the following command:
-
Clone the Repository:
- Clone this repository to your local machine:
git clone https://github.com/sp4r1ng/snake_game cd snake_game
- Clone this repository to your local machine:
-
Compile the Project:
- Use
g++to compile the project with SFML libraries:g++ -o snake_game main.cpp -lsfml-graphics -lsfml-window -lsfml-system
- Use
-
Run the Game:
- Once compiled, run the game with:
./snake_game
- Once compiled, run the game with:
- Movement: Use the arrow keys (up, down, left, right) to control the snake.
- Objective: Avoid the obstacles that randomly appear on the screen.
