A fully-featured cooperative dungeon crawler built from scratch in C++17 โ no game frameworks, no libraries, just raw systems programming.
C++17 ยท 8,000+ Lines ยท 40+ Source Files ยท Cross-Platform ยท macOS / Linux / Windows
Main menu โ running in an 80ร25 terminal window with color mode
![]() Fog-of-war with torch illumination |
![]() Bomb explosion with LOS blast radius |
![]() Physics-based pushable obstacles |
![]() Animated riddle popup system |
This isn't a homework submission โ it's an engine. Two players share a keyboard and cooperate in real-time across multi-room dungeons, solving puzzles, dodging explosions, and navigating fog-of-war darkness. Every system โ rendering, physics, input, recording โ was hand-built.
| What I Built | Why It Matters |
|---|---|
| ๐งช Deterministic replay & silent testing framework | Record gameplay โ replay with seeded RNG โ verify events automatically. This is, fundamentally, an automated game QA pipeline โ the exact problem space Duzz.ai operates in. |
| ๐๏ธ 4-level OOP hierarchy with polymorphic dispatch | GameObject โ StaticObject/PickableObject/InteractableObject โ 10+ concrete types. Factory pattern, virtual clone, clean separation of concerns. |
| ๐ Fog-of-war visibility engine | Dark zones with ray-traced line-of-sight, torch illumination radius, 4-level visibility states (DARK โ EDGE โ INNER โ CLOSE). |
| ๐งฒ Custom physics system | Momentum-based spring launchers, Bresenham line traversal for multi-step movement, force-based pushable obstacles. |
| ๐ฃ Explosion system with LOS calculation | Bombs with fuse timers, circular blast radius, wall occlusion via line-of-sight checks, chain destruction of breakable objects. |
| ๐ฅ๏ธ Cross-platform console abstraction | Single codebase renders to Windows (conio.h), macOS, and Linux (termios) โ clean #ifdef separation, ANSI escape codes, non-blocking I/O. |
This is the system most relevant to Duzz.ai's mission of autonomous game testing.
The game has a built-in record โ replay โ verify pipeline โ a miniature version of the automated QA systems that Duzz.ai builds at scale:
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ SAVE MODE โ โโโโถ โ LOAD MODE โ โโโโถ โ SILENT MODE โ
โ Records all โ โ Replays from โ โ Headless run, โ
โ player I/O โ โ steps file โ โ diffs results โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
- Deterministic seeded RNG ensures identical riddle assignment across record and replay.
- Screen file checksums at replay time catch level-file drift between sessions.
- Event-level verification โ screen changes, life losses, riddle outcomes are diffed line-by-line.
- Factory pattern (
Game::createFromArgs()) instantiatesNormalGameorLoadedGamefrom CLI args โ zero coupling between play and test modes.
# Record a session
./game -save
# Replay it visually
./game -load
# Run headless verification (CI-friendly)
./game -load -silent
# โ "Test passed" or "Test not passed" โโโโโโโโโโโโโโโโ
โ GameObject โ โ abstract base (virtual clone, draw, update)
โโโโโโโโฌโโโโโโโโ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ StaticObject โ โPickableObjectโ โInteractableObj โ
โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโฌโโโโโโโโโ
โ โ โ
โโโโโโฌโโโโดโโโโฌโโโโ โโโโโผโโโโโ โโโโโโโผโโโโโโ
โ โ โ โ โ โ โ โ โ โ
Wall Break- Switch Air Key Torch Bomb Door Switch Riddle
able Wall
Wall
โโโโโโโโโโโโ
โ Game โ โ abstract base (Factory pattern)
โโโโโโฌโโโโโโ
โโโโโโโโโดโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โNormalGame โ โ LoadedGame โ โ replay/silent testing
โโโโโโโโโโโโโ โโโโโโโโโโโโโโ
Key design patterns: Factory Method ยท Polymorphism ยท Virtual Clone ยท Template Method ยท Composition (Room โ GameObject) ยท Singleton-style static instance (Game::currentInstance)
Both players must work together โ collecting keys, activating switches, navigating doors, and solving multiple-choice riddles โ to reach the final room. Each room is an 80ร25 ASCII map loaded from .screen.txt files with metadata.
Rooms can define rectangular dark zones. Without a torch, these areas are completely hidden. Picking up a torch creates a real-time illumination radius with graduated visibility.
Placeable bombs with a 50-tick fuse and a 5-cell blast radius. Explosions check line-of-sight to avoid blasting through walls, can destroy breakable obstacles, trigger switches, and eliminate keys (causing game-over if critical items are lost). Includes a blinking fuse animation and post-explosion visual effect.
Multi-cell spring objects compressed by player movement. When fully compressed, they launch the player using a momentum system with Bresenham-based multi-step traversal โ the player slides across the room until hitting a wall or obstacle.
Multi-block obstacles with computed edge detection and weight-based force requirements. Players push them by walking into them โ heavier obstacles need more force (or springs).
Walking into a ? triggers an animated popup overlay with a multiple-choice question. Correct answers clear the path; wrong answers deduct a life.
Both players share one keyboard. Input is case-insensitive. Characters auto-move and will keep going until they hit a wall or press STAY.
| Action | Player 1 ($) |
Player 2 (&) |
|---|---|---|
| โ UP | W |
I |
| โ DOWN | X |
M |
| โ LEFT | A |
J |
| โ RIGHT | D |
L |
| โ STAY | S |
K |
| โฌ DISPOSE | E |
O |
ESCโ Pause ยทH(from pause) โ Main Menu
# Clone
git clone https://github.com/Etayde/Cpp_Adv_World_Game_Engine.git
cd cpp_project_2025
# Build (requires g++ with C++17 support)
make
# Play
./game
# Play with color mode
# โ Press [2] in the main menu to toggle color mode
# Record a session for testing
./game -save
# Replay
./game adv-world.steps.txt
# Silent verification (headless, CI-ready)
./game adv-world.steps.txt -silentRequirements: Any C++17-capable compiler (g++, clang++). No external dependencies.
Create custom rooms by adding adv-worldXX.screen.txt files (auto-discovered via std::filesystem). Each file is an 80ร25 ASCII map followed by a metadata block:
| Symbol | Object | Behavior |
|---|---|---|
W |
Wall | Indestructible |
w |
Breakable Wall | Destroyed by bombs |
# |
Spring | Launches players |
* |
Obstacle | Pushable block |
Z |
Switch Wall | Removed when switches activate |
K |
Key | Unlocks doors |
! |
Torch | Illuminates dark zones |
@ |
Bomb | Pickup โ place โ explode |
\ / |
Switch | Toggles obstacles/doors |
? |
Riddle | Multiple-choice puzzle |
0-9 |
Door | Requires keys/switches to pass |
L |
Legend Anchor | HUD placement marker |
---METADATA---
SPAWN 3 10 # Player spawn point
SPAWN_PREV 75 17 # Spawn when returning from next room
NEXT_ROOM 1 # Next room ID (-1 = final room)
PREV_ROOM -1 # Previous room ID (-1 = first room)
DOOR 1 2 0 # Door 1 needs 2 keys, 0 switches
DARK_ZONE 20 5 46 14 # Dark rectangle (top-left โ bottom-right)
.
โโโ main.cpp # Entry point
โโโ Game.h/cpp # Abstract base โ state machine, room management
โโโ NormalGame.h/cpp # Live gameplay + recording mode
โโโ LoadedGame.h/cpp # Replay + silent verification mode
โโโ Player.h/cpp # Movement, physics, inventory, collisions
โโโ Room.h/cpp # Room state, visibility, object management
โโโ GameObject.h/cpp # Abstract game object base class
โโโ Bomb.h/cpp # Explosive with fuse timer + LOS blast
โโโ Spring.h/cpp # Compressible launcher with momentum
โโโ Obstacle.h/cpp # Multi-block pushable physics objects
โโโ Riddle.h/cpp # Animated popup quiz system
โโโ Recorder.h/cpp # Action serialization / deserialization
โโโ LevelLoader.h/cpp # Map parser + std::filesystem discovery
โโโ Console.h # Cross-platform terminal abstraction
โโโ Renderer.h # Silent-mode-aware rendering proxy
โโโ Momentum.h/cpp # Velocity / launch frame tracking
โโโ Makefile # Build configuration
โโโ riddle.txt # Riddle question database
โโโ adv-world*.screen.txt # Level files (3 included)
Etay De Beer , LinkedIn: www.linkedin.com/in/etaydebeer
Built as a C++ collage course project โ evolved into a full game engine with QA automation, physics, fog-of-war, and extensible level design.




