A classic Snake game, brought to life with C++ and SFML. Simple yet dynamic, written from scratch — head to tail 🐍.
- ✅ Fullscreen mode
- ✅ Smooth movement with interpolation
- ✅ Collision with walls and snake’s own body
- ✅ Food spawns outside the snake
- ✅ Real-time score tracking
- ✅ Restart with the
Rkey - ✅ Quit anytime with
Q
| Key | Action |
|---|---|
| W | Move up |
| S | Move down |
| A | Move left |
| D | Move right |
| R | Restart the game |
| Q | Quit the game |
- C++17 compatible compiler
- SFML 2.5+
- CMake ≥ 3.16
git clone https://github.com/Sam1624/sfml-snake.git
cd sfml-snake
mkdir build && cd build
cmake ..
make
./snakeIf SFML is installed in a non-default location:
cmake -DSFML_DIR=/path/to/SFML ...
├── CMakeLists.txt
├── LICENSE
├── .gitignore
├── .clangd
├── include/
│ ├── Config.hpp
│ ├── Food.hpp
│ ├── Game.hpp
│ └── Snake.hpp
├── src/
│ ├── Food.cpp
│ ├── Game.cpp
│ ├── Snake.cpp
│ └── main.cpp
├── resources/
│ ├── font.ttf
│ └── gameplay.gif
This project is licensed under the MIT License. See the LICENSE file for details.
