Skip to content

Twiddllo/Maze-Runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐ŸŽฎ Maze Runner

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.


๐Ÿ“– About

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

โœจ Features

  • ๐Ÿงฑ 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 ๐Ÿ‘€)

๐ŸŽฎ Controls

Key Action
W Move Up
S Move Down
A Move Left
D Move Right
O Exit game (with confirmation)

Controls are case-insensitive.


๐Ÿ› ๏ธ Building & Running

Prerequisites

  • Windows OS
  • C++ compiler (GCC / MinGW or MSVC)
  • conio.h support (Windows-only)

Compilation

GCC / MinGW

g++ app.cpp -o maze_runner

MSVC

cl app.cpp /Fe:maze_runner.exe

Running

maze_runner.exe

๐Ÿ“ Project Structure

MAZE RUNNER/
โ”œโ”€โ”€ app.cpp      # Entire game logic
โ””โ”€โ”€ README.md    # Documentation

No external files are required. Game history is stored in memory only (per run).


๐ŸŽฏ Game Mechanics

Player

  • Starts at the first empty space in the maze
  • Represented by P
  • Has limited hearts (configurable)

Ghosts

  • 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)

Exit

  • Represented by O
  • Reaching it ends the game with bonus score

Scoring

  • +20 points for reaching the exit
  • โˆ’5 points when caught by a ghost
  • Optional Smart Scoring:
    • Rewards faster completion
    • Gives bonus for remaining lives

Game Over

  • Happens when lives reach 0
  • Score resets to 0 and is added to history

โš™๏ธ Settings Menu

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.


๐Ÿง  Ghost Movement Modes

1๏ธโƒฃ Movement-Based

  • Ghosts move every N player actions
  • More predictable
  • Easier to plan around

2๏ธโƒฃ Time-Based

  • Ghosts move even if player does nothing
  • Uses clock() for timing
  • More pressure, harder gameplay

๐Ÿ“Š Leaderboard

  • Stored in memory using vector
  • Sorted automatically (highest score first)
  • Displays top 20 players only
  • Reset when program exits

๐Ÿ› Known Limitations

  • Windows-only (conio.h, system("cls"))
  • Ghost AI is direct and non-pathfinding
  • No save/load between runs
  • ASCII rendering depends on terminal width

๐Ÿ”ฎ Possible Future Improvements

  • Cross-platform (remove conio.h)
  • File-based persistent leaderboard
  • Pathfinding ghosts (BFS / A*)
  • Dynamic maze generation
  • Difficulty presets
  • Sound effects

๐Ÿ‘ค Author

twiddllo


๐Ÿซ Institution

Shahid Chamran University (SCU)


๐Ÿ“„ License

Open-source, educational use only.


This project prioritizes clarity, control, and raw logic over polish. If something feels hard โ€” thatโ€™s intentional.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors