This is a classic Snake game implemented in C++ using the clui
library for color and input handling. The game features two players controlling their snakes on a grid, with the goal of growing their snakes by eating apples while avoiding collisions with walls, bombs, and each other.
- Two-player Mode: Players control two snakes simultaneously.
- Apple Eating: Snakes grow in length when they eat apples.
- Bombs: Bombs appear on the grid, and snakes must avoid them.
- Customizable Game Speed: Players can choose from fast, medium, or slow game speeds.
- Score Tracking: Scores are tracked for both players and displayed at the end of the game.
- User Management: Users can add new usernames and update existing ones.
- Clone the repository:
git clone https://github.com/yourusername/snake-game.git
Navigate to the project directory:
cd snake-game
- Compile the code:
g++ -o snake_game main.cpp
3.Run the game:
./snake_game
Controls Player 1 (Snake 1):
W
- Move Up.
A
- Move Left.
S
- Move Down.
D
- Move Right.
Player 2 (Snake 2):
Arrow Up
- Move Up.
Arrow Left
- Move Left.
Arrow Down
- Move Down.
Arrow Right
- Move Right.
Game Menu
START GAME: Begin a new game.
POINTS TABLE: View the current scores and rankings.
ADD USERS: Add or change usernames for players.
EXIT: Exit the game.
Contributing
We welcome contributions! To contribute:
Fork the repository.
Create a new branch for your feature or bug fix.
Make your changes and commit them.
Submit a pull request.
License
This project is licensed under the MIT License.