A classic snake game implemented in C++.
- Classic snake gameplay
- Keyboard controls
- Threaded input and game logic
- Unit tests using Google Test framework
- A C++ compiler (like g++)
- CMake (version 3.10 or higher)
- Google Test library
- Create a build directory:
mkdir build
- Navigate to the build directory:
cd build - Run CMake to configure the project:
cmake ..
- Compile the project:
make
This will create two executables in the build directory: snake_game and snake_tests.
To play the game, run the following command from the build directory:
./snake_gameTo run the tests, execute the following command from the build directory:
./snake_testsUse the WASD keys to control the snake's direction. The goal is to eat the food that appears on the screen, which makes the snake grow longer. The game ends if the snake runs into the wall or into itself.
This project is licensed under the MIT License. See the LICENSE file for details.