A terminal-based maze game written in C++ where you navigate through a large ASCII maze while being hunted by ghosts โ now with settings, smarter scoring, two ghost AI modes, and in-memory leaderboards.
Maze Runner is a console maze game developed as a university project for Shahid Chamran University (SCU). Your goal is simple: survive, avoid ghosts, and reach the exit. The challenge comes from configurable ghost behavior, limited lives, and score pressure.
This version is a major upgrade over the previous one, focusing on:
- Better game control via settings
- Two different ghost movement models
- Improved UI inside the terminal
- Clean separation of gameplay logic
- ๐งฑ Large ASCII Maze (51ร76)
- ๐ป Configurable Ghost Enemies (1โ10 ghosts)
- ๐ง Two Ghost Movement Modes
- Movement-based (every N player moves)
- Time-based (every X seconds)
- โค๏ธ Custom Lives System (1โ10 hearts)
- ๐ Score System with optional smart scoring
- ๐ Top-20 In-Memory Leaderboard (sorted)
- โ๏ธ Full Settings Menu (change difficulty at runtime)
- ๐น๏ธ Real-Time Controls using
conio.h - ๐งช Hidden Cheat Modes (intentional ๐)
| Key | Action |
|---|---|
W |
Move Up |
S |
Move Down |
A |
Move Left |
D |
Move Right |
O |
Exit game (with confirmation) |
Controls are case-insensitive.
- Windows OS
- C++ compiler (GCC / MinGW or MSVC)
conio.hsupport (Windows-only)
GCC / MinGW
g++ app.cpp -o maze_runnerMSVC
cl app.cpp /Fe:maze_runner.exemaze_runner.exeMAZE RUNNER/
โโโ app.cpp # Entire game logic
โโโ README.md # Documentation
No external files are required. Game history is stored in memory only (per run).
- Starts at the first empty space in the maze
- Represented by
P - Has limited hearts (configurable)
- Represented by
G - Spawn randomly on empty tiles
- Chase the player directly (greedy movement)
- Can move:
- Every N moves (movement-based)
- Every X seconds (time-based)
- Represented by
O - Reaching it ends the game with bonus score
- +20 points for reaching the exit
- โ5 points when caught by a ghost
- Optional Smart Scoring:
- Rewards faster completion
- Gives bonus for remaining lives
- Happens when lives reach 0
- Score resets to 0 and is added to history
Accessible from the main menu.
You can modify:
- Number of ghosts (1โ10)
- Ghost speed (1โ20)
- Player hearts (1โ10)
- Enable / disable smart scoring
- Switch ghost movement mode
- Adjust time interval (time-based mode only)
All changes apply immediately.
- Ghosts move every N player actions
- More predictable
- Easier to plan around
- Ghosts move even if player does nothing
- Uses
clock()for timing - More pressure, harder gameplay
- Stored in memory using
vector - Sorted automatically (highest score first)
- Displays top 20 players only
- Reset when program exits
- Windows-only (
conio.h,system("cls")) - Ghost AI is direct and non-pathfinding
- No save/load between runs
- ASCII rendering depends on terminal width
- Cross-platform (remove
conio.h) - File-based persistent leaderboard
- Pathfinding ghosts (BFS / A*)
- Dynamic maze generation
- Difficulty presets
- Sound effects
twiddllo
Shahid Chamran University (SCU)
Open-source, educational use only.
This project prioritizes clarity, control, and raw logic over polish. If something feels hard โ thatโs intentional.