Classic arcade game reimagined in C++ with advanced OOP design
๐ฎ Quick Start: Run build.bat to compile, run.bat to play!
๐ Full Guide: See QUICK_START.md
Feature-rich C++ console implementation of Donkey Kong, showcasing inheritance, polymorphism, file I/O, and game state management.
๐ฅ Team Project: Developed collaboratively with @gurbe22.
- Regular - Classic arcade gameplay
- Save - Record gameplay for replay
- Load - Watch recorded games step-by-step
- Silent - Automated replay verification
Gameplay:
- 3 challenging levels (dkong_01/02/03)
- Dynamic enemies: Barrels (
O), Ghosts (x), Special Ghosts - Hammer power-up (
P) - 20 moves of invincibility - Lives system with 3 hearts
- Goal: Reach Pauline (
$) at the top
Technical:
- Polymorphic game modes with virtual methods
- Save/load system with file I/O
- Enemy hierarchy with specialized behaviors
- Collision detection and console rendering
- RAII principles and STL containers
- Get the latest release
- Extract ZIP
- Double-click
DonkeyKongOG.exe
Prerequisites: Windows, Visual Studio 2019+, C++17
Using Scripts (Easiest):
build.bat # Compiles the game
run.bat # Runs the gameUsing Visual Studio:
git clone https://github.com/Dan-Ofri/DonkeyKongOG.git
cd DonkeyKongOG
# Open DonkeyKongOG.sln in Visual Studio
# Press F5 to build and runCommand Line:
MSBuild DonkeyKongOG.sln /p:Configuration=Release /p:Platform=x64
.\x64\Release\DonkeyKongOG.exe| Key | Action |
|---|---|
| A/D | Move Left/Right |
| W | Climb Up / Jump |
| X | Climb Down |
| S | Stay in place |
| ESC | Pause game |
| Symbol | Meaning |
|---|---|
@ |
Mario (player) |
$ |
Pauline (goal) |
& |
Donkey Kong |
H |
Ladder |
=/</> |
Floors |
O |
Barrel (enemy) |
x |
Ghost (enemy) |
P |
Hammer (power-up) |
โฅ |
Life |
Objective: Navigate platforms and ladders, avoid enemies, reach Pauline to win!
DonkeyKongOG/
โโโ Core Game Logic
โ โโโ game.h/cpp # Base orchestration
โ โโโ regularGame.h/cpp # Standard gameplay
โ โโโ saveGame.h/cpp # Save functionality
โ โโโ loadGame.h/cpp # Replay system
โ โโโ loadSilentGame.h/cpp # Silent verification
โ
โโโ Game Entities
โ โโโ mario.h/cpp # Player character
โ โโโ enemy.h/cpp # Enemy base class
โ โโโ barrel.h/cpp # Barrel enemy
โ โโโ ghost.h/cpp # Ghost enemy
โ โโโ specialGhost.h/cpp # Special ghost
โ
โโโ Game Systems
โโโ board.h/cpp # Level management
โโโ gameConfig.h/cpp # Constants
โโโ point.h/cpp # Position handling
โโโ utils.h/cpp # Helper functions
Game (Abstract Base)
โโโ RegularGame
โโโ SaveGame
โโโ LoadGame
โโโ LoadSilentGame
Enemy (Abstract Base)
โโโ Barrel
โโโ Ghost
โโโ SpecialGhost
Strategy Pattern - Game Modes:
class Game {
protected:
virtual void goToSleep() const = 0;
virtual bool processGameInput(...) = 0;
};Polymorphism - Enemy Behavior:
class Enemy {
public:
virtual void move(Board& board) = 0;
virtual char getChar() const = 0;
virtual ~Enemy() {}
};- C++17 - Core language with STL containers
- Visual Studio 2019+ - IDE and compiler
- Windows Console API - Terminal rendering
- File Streams - Save/load functionality
OOP Mastery:
- Advanced inheritance and polymorphism
- Abstract classes and virtual functions
- RAII and memory management
Software Design:
- Design patterns (Strategy, Template Method)
- Modular architecture
- File I/O and state management
Game Development:
- Game loop implementation
- Collision detection
- Replay system with deterministic recording
MIT License - see LICENSE file for details.
Dan Ofri
- GitHub: @Dan-Ofri
- Email: ofridan@gmail.com
- Course: Object-Oriented Programming in C++
- Academic Project: Year 2, Semester A (2024/2025)
- Original Game: Donkey Kong by Nintendo (1981)
โญ If you enjoyed this project, please give it a star!
Made with โค๏ธ and C++