This Snake Game is implemented in C++ and demonstrates the classic snake-eating-food gameplay. The snake grows longer as it consumes food, and the game ends when the snake collides with itself.
- Real-time movement of the snake on the console.
- Random spawning of food for the snake to eat.
- Keeps track of the player's score.
- Simple and easy-to-understand gameplay.
- W or Up Arrow: Move the snake upwards.
- A or Left Arrow: Move the snake leftwards.
- S or Down Arrow: Move the snake downwards.
- D or Right Arrow: Move the snake rightwards.
- Clone or download the repository to your local machine.
- Compile the
snake_game.cpp
file in a C++ compiler. - Run the compiled program in a console/terminal.
- Use the keyboard controls to navigate the snake and eat the food.
- Avoid collisions with the walls and the snake itself.
To run this game locally, you need a C++ compiler and a code editor/IDE. Follow these steps:
- Clone or download this repository.
- Compile the
snake_game.cpp
file using your preferred C++ compiler. - Run the compiled executable in your console/terminal.