- ๐ Introduction
- โจ Features
- ๐ฎ How to Play
- ๐ฏ Game Controls
- ๐ Installation Guide
- ๐น๏ธ Game Mechanics
- ๐ก Code Structure
- ๐ Future Enhancements
- ๐ฅ Contributors
This game is made by Bitwise Wizards.This project is a console-based Snake Game implemented in C++. It follows an object-oriented approach using classes and inheritance to manage game components like the snake, fruit, and game board.Our code is for Windows and Linux. It will work in both OS.
- ๐ฏ Grid-based gameplay.
- ๐ฎ Snake movement using keyboard controls.
- ๐ Normal and special fruits for scoring.
- ๐ง Obstacles appear as the game progresses.
- ๐งฑ Wall collision mode (can be enabled or disabled).
- ๐ Dynamic difficulty adjustment.
- ๐บ Clear UI with instructions and score tracking.
- Control the snake using
W, A, S, Dor arrow keys. - ๐ Eat fruits (
@for normal,$for special) to grow and score points. - ๐ง Avoid walls and obstacles (
#). - โ ๏ธ Game over if the snake collides with itself or obstacles.
- ๐ Restart or exit after game over.
| ๐ฎ Key | ๐น Action |
|---|---|
W / โฌ๏ธ |
Move Up |
S / โฌ๏ธ |
Move Down |
A / โฌ
๏ธ |
Move Left |
D / โก๏ธ |
Move Right |
P |
Pause |
R |
Resume |
X |
Reset Game |
ESC |
Exit Game |
Follow these steps to install and run the Snake Game on your machine:
- Ensure you have Git installed, then run:
git clone https://github.com/Raj-Patel7807/Snake_Game.gitcd Snake_Game- Make sure you have g++ (GCC compiler) installed, then compile the code:
g++ main.cpp -o main- For Linux Users ๐ง:
./main- For Windows Users ๐ช:
main.exe- If you prefer SSH over HTTPS:
git clone git@github.com:Raj-Patel7807/Snake_Game.git- If you have already cloned the repo and want to get the latest updates:
git pull origin mainEnjoy the game! ๐๐ฅ
- ๐ The snake moves continuously in the last chosen direction.
- ๐ Eating a normal fruit (@) increases the score by 5 points.
- ๐ฐ Eating a special fruit ($) increases the score by 20 points.
- ๐ง Once the score reaches 50, obstacles appear.
- ๐ผ The difficulty increases dynamically with score progression.
The game is implemented using Object-Oriented Programming (OOP) principles:
- ๐ ๏ธ
Game(Base Class): Defines the core game logic and properties. - ๐
Snake(Inherits from Game): Handles the snakeโs movement. - ๐
Fruit(Inherits from Snake): Manages fruit generation. - ๐ฎ
Main(Inherits from Fruit): Controls the game loop, rendering, and input handling.
- ๐ฎ Multiple levels with increasing complexity.
- ๐ซ Multiplayer mode with two snakes.
- ๐ High score tracking system.
- ๐ค AI-controlled opponent snakes.
- ๐จ GUI-based version using a graphics library.
- ๐ Raj Patel
- ๐ Tirth Patel