Skip to content
ย 
ย 

Latest commit

ย 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆ Donkey Kong - C++ Console Game

C++ Visual Studio License

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


๐Ÿ“– About

Feature-rich C++ console implementation of Donkey Kong, showcasing inheritance, polymorphism, file I/O, and game state management.

๐Ÿ‘ฅ Team Project: Developed collaboratively with @gurbe22.

๐ŸŽฎ Game Modes

  • Regular - Classic arcade gameplay
  • Save - Record gameplay for replay
  • Load - Watch recorded games step-by-step
  • Silent - Automated replay verification

โœจ Key Features

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

๐Ÿš€ Quick Start

Option 1: Download & Play

  1. Get the latest release
  2. Extract ZIP
  3. Double-click DonkeyKongOG.exe

Option 2: Build from Source

Prerequisites: Windows, Visual Studio 2019+, C++17

Using Scripts (Easiest):

build.bat  # Compiles the game
run.bat    # Runs the game

Using Visual Studio:

git clone https://github.com/Dan-Ofri/DonkeyKongOG.git
cd DonkeyKongOG
# Open DonkeyKongOG.sln in Visual Studio
# Press F5 to build and run

Command Line:

MSBuild DonkeyKongOG.sln /p:Configuration=Release /p:Platform=x64
.\x64\Release\DonkeyKongOG.exe

๐Ÿ•น๏ธ Controls

Key Action
A/D Move Left/Right
W Climb Up / Jump
X Climb Down
S Stay in place
ESC Pause game

๐ŸŽฏ Game Elements

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!


๐Ÿ—๏ธ Architecture

Project Structure

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

Class Hierarchy

Game (Abstract Base)
โ”œโ”€โ”€ RegularGame
โ”œโ”€โ”€ SaveGame
โ”œโ”€โ”€ LoadGame
โ””โ”€โ”€ LoadSilentGame

Enemy (Abstract Base)
โ”œโ”€โ”€ Barrel
โ”œโ”€โ”€ Ghost
โ””โ”€โ”€ SpecialGhost

Design Patterns

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() {}
};

๐Ÿ› ๏ธ Technologies

  • C++17 - Core language with STL containers
  • Visual Studio 2019+ - IDE and compiler
  • Windows Console API - Terminal rendering
  • File Streams - Save/load functionality

๐Ÿ“š Learning Outcomes

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

๐Ÿ“„ License

MIT License - see LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Dan Ofri


๐Ÿ™ Acknowledgments

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

About

๐Ÿฆ Classic Donkey Kong arcade game in C++ with advanced OOP design. Features polymorphic game modes, enemy hierarchy, save/load system, and replay functionality using design patterns.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages