Welcome to the classic Snake game! This project is a simple console-based implementation of the Snake game using C++.
This project is a basic implementation of the Snake game. The objective of the game is to navigate the snake to eat the fruit, which makes the snake grow longer. The game ends if the snake runs into the wall or its own tail. The player's score increases with each fruit eaten.
- Snake moves within a defined boundary.
- Snake grows longer with each fruit eaten.
- Score tracking.
- Adjustable difficulty levels.
- Pause and resume functionality.
- Displays the highest score for the current session.
- A C++ compiler (e.g., GCC, MSVC)
- Windows operating system (due to the use of
<conio.h>
and<windows.h>
libraries)
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/snake-game.git cd snake-game
-
Compile the source code using a C++ compiler:
g++ snake_game.cpp -o snake_game
-
Run the executable:
./snake_game
- Run the game executable from your command line or terminal.
- Enter your name when prompted.
- Choose the game difficulty level.
- Use the controls to play the game.
w
- Move Ups
- Move Downa
- Move Leftd
- Move Rightp
- Pause/Resumex
- Exit the game
Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you have any suggestions or find any bugs.