add README file and images

This commit is contained in:
2025-09-23 06:07:39 +03:30
parent d1c58b50e8
commit ddba3d6618
4 changed files with 90 additions and 0 deletions
+90
View File
@@ -0,0 +1,90 @@
# 🐍 Snake Game (C++ Console Edition)
A colorful and modern **Snake Game** built entirely in **C++** for the terminal.
This version includes a **menu system, persistent leaderboard, scoring with time tracking, smooth controls, and a retro ASCII-art UI** that makes the classic snake experience both fun and polished.
---
## 🎮 Features
- 🏠 **Main Menu:** Start a new game, view the leaderboard, or exit.
- 👤 **Player Names:** Each player enters their name before starting, and their performance is tracked.
- 🎯 **Scoring System:**
- +10 points for each fruit collected
- Timer shows how long you survived
- Score combined with time for leaderboard ranking
- 🏆 **Leaderboard:** Sorted by **score** (higher is better), with **time** used as a tiebreaker.
- 🐍 **Snake Mechanics:** Grow longer each time you eat fruit, but avoid running into your own tail!
- 🔄 **Wrap-Around Walls:** When hitting borders, snake reappears on the opposite side.
-**Time Tracking:** Total game duration is displayed alongside your score.
- 🎨 **Colorful Console Graphics:** Snake, fruits, borders, and leaderboard are all highlighted with ANSI colors.
- 💾 **Persistent Save:** Player data is stored in `leaderboard.txt` so you can keep competing across sessions.
-**Fast and Simple UI:** Runs directly in terminal — no extra dependencies.
---
## 📷 Screenshots
### 🏠 Main Menu
![Menu](./image/Menu.png)
---
### 🏆 Leaderboard
![Leaderboard](./image/leaderboard.png)
---
### 🎮 In-Game
![Gameplay](./image/Game.png)
---
## ⚙️ Setup & Run
### ✅ Requirements
- A C++ compiler (e.g., g++, MSVC)
- Windows OS (project uses `conio.h` and `windows.h`)
- Console with UTF-8 and ANSI color support
### 📦 Build & Run
#### On Windows:
```bash
g++ -o snake snake.cpp -std=c++11
snake.exe
```
#### On Linux/macOS:
> ⚠️ This version relies on Windows-specific libraries. For Linux/macOS, small adjustments are required (replace `conio.h` and `windows.h` with platform-specific functions).
---
## 🕹️ Controls
- `W` or **Up Arrow** → Move Up
- `S` or **Down Arrow** → Move Down
- `A` or **Left Arrow** → Move Left
- `D` or **Right Arrow** → Move Right
- `ESC` → End the game immediately
---
## 📁 Project Files
- `snake.cpp` → Main source code
- `leaderboard.txt` → Stores player leaderboard data
---
## 👤 Creator
> **Name:** _[Meraj Derafshi]_
> **Contact/Portfolio:** _[https://github.com/MerajDerafshi]_
---
## 📜 License
This project is open-source. Feel free to use, modify, or expand it for learning or fun. Attribution is appreciated.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB