https://github.com/yashsaini99/snakegame
A Snake game made with C++
https://github.com/yashsaini99/snakegame
cpp
Last synced: 8 months ago
JSON representation
A Snake game made with C++
- Host: GitHub
- URL: https://github.com/yashsaini99/snakegame
- Owner: YashSaini99
- Created: 2023-08-28T13:57:22.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-28T08:24:24.000Z (almost 2 years ago)
- Last Synced: 2024-12-26T21:08:51.963Z (over 1 year ago)
- Topics: cpp
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snake Game
This is a simple Snake game implemented in C++ that can be played in the terminal. The game includes basic functionalities such as snake movement and food generation.
## Features
- Classic Snake gameplay
- Playable in the terminal
- Simple and intuitive controls
## Getting Started
### Prerequisites
To compile and run the game, you need to have a C++ compiler installed on your machine.
### Installation
1. Clone the repository:
```sh
git clone https://github.com/YashSaini99/SnakeGame.git
```
2. Navigate to the project directory:
```sh
cd snake-game
```
3. Compile the game:
```sh
g++ snake.cpp -o snake
```
4. Run the game:
```sh
./snake
```
## How to Play
- Use the arrow keys to control the snake's direction.
- Eat the food to grow longer.
- Avoid running into the walls or the snake's own body.
- The game ends when the snake crashes into itself or the wall.
## Controls
- `w` - Move up
- `s` - Move down
- `a` - Move left
- `d` - Move right
## Contributing
Contributions are welcome! If you have any ideas for improvements or encounter any issues, please feel free to open an issue or submit a pull request.