Classic console-based Snake game implemented in C++ with object-oriented design. Features real-time gameplay, collision detection, and terminal-based controls using WASD keys.
| .gitignore | ||
| best_score.txt | ||
| CMakeLists.txt | ||
| Direction.h | ||
| Food.cpp | ||
| Food.h | ||
| Game.cpp | ||
| Game.h | ||
| main.cpp | ||
| Point.h | ||
| README.md | ||
| Snake.cpp | ||
| Snake.h | ||
🐍 Snake Game
Classic Snake game implemented in C++ with a console interface.
📁 Project Structure
main.cpp— Entry pointGame.*— Game logic and renderingSnake.*— Snake class implementationFood.*— Food generation systemPoint.h— Coordinate structureDirection.h— Direction enumerationbest_score.txt— High score storageCMakeLists.txt— Build configuration
🛠️ Requirements
- C++11 or higher
- CMake 3.10+
- Linux/Unix terminal
🎮 Features
- Console-based graphics
- WASD controls
- Food generation
- Collision detection
- Growing snake mechanics
- Score tracking
- Best score persistence
🎯 Controls
- W — Move up
- S — Move down
- A — Move left
- D — Move right
- Q — Quit game
📦 Build and Run
mkdir build && cd build
cmake ..
make
./Snake