A terminal-based RPG written in C++.
The project is built around object-oriented programming and is designed to gradually evolve into a dungeon-crawling RPG where the player progresses through floors, fights enemies, gains experience, earns gold, and becomes stronger.
-
Turn-based combat system
-
Player character system
-
Multiple player classes
- Samurai
- Warrior
-
Enemy system
-
Enemy Factory for creating enemies
-
Health, attack, and defense stats
-
Experience and leveling
-
Gold rewards
-
Enemy bleed resistance
-
Colored terminal UI
-
ASCII-based game interface
- Dungeon system
- Floors 1–100
- Floor-based enemy pools
- Elite enemies
- Floor 100 boss
- Progressive enemy difficulty
- Loot and item system
- Weapons and equipment
- Armor system
- Consumables
- Save/load system
- Player progression
- Quests and events
├── CMakeLists.txt
├── compile_flags.txt
├── game
├── include
│ ├── ascii
│ │ ├── Colors.h
│ │ ├── Logo.h
│ │ └── UI.h
│ │
│ ├── battle
│ │ └── Battle.h
│ │
│ └── entities
│ ├── Character.h
│ │
│ ├── npc
│ │ ├── EnemyFactory.h
│ │ └── Enemy.h
│ │
│ └── player
│ ├── Player.h
│ └── classes
│ ├── Samurai.h
│ └── Warrior.h
│
├── main.cpp
├── Makefile
├── README.md
│
└── src
├── ascii
│ └── UI.cpp
│
├── battle
│ └── Battle.cpp
│
└── entities
├── Character.cpp
│
├── npc
│ ├── Enemy.cpp
│ └── EnemyFactory.cpp
│
└── player
├── Player.cpp
└── classes
├── Samurai.cpp
└── Warrior.cpp
The project uses a basic object-oriented architecture.
Character acts as the base class for entities that participate in combat.
It contains common attributes such as:
- HP
- Attack
- Defense
- Level
Both players and enemies can build upon this base class.
Character
│
├── Player
│ ├── Samurai
│ └── Warrior
│
└── Enemy
Player represents the player's character and handles player-specific functionality such as:
- Experience
- Leveling
- Gold
- Combat actions
- Player progression
Player classes can specialize the base player behavior.
Currently available classes:
A class focused around offensive combat and specialized abilities.
A class focused around durability and direct combat.
More classes can be added later without changing the core player system.
Enemy represents enemies encountered during combat.
Enemies have attributes such as:
- Name
- HP
- Attack
- Defense
- Level
- Experience reward
- Gold reward
- Bleed resistance
- Enemy type
EnemyFactory is responsible for creating enemies.
Instead of constructing enemies directly throughout the game, the factory provides a central place for enemy creation.
Conceptually:
Game
│
▼
EnemyFactory
│
├── Goblin
├── Orc
├── Skeleton
└── ...
This will become particularly useful when the dungeon system is implemented.
The battle system handles combat between the player and enemies.
A simplified battle flow is:
Player
│
▼
Encounter Enemy
│
▼
Start Battle
│
├── Player Action
│ │
│ ▼
│ Damage Enemy
│
├── Enemy Action
│ │
│ ▼
│ Damage Player
│
└── Repeat
│
▼
Battle Result
When an enemy is defeated, the player receives rewards such as:
XP
Gold
The long-term goal of the project is to introduce a 100-floor dungeon.
The player starts at:
Floor 1
and progresses toward:
Floor 100
Each floor will contain enemies appropriate to its difficulty.
A potential progression system:
Floor 1–10
↓
Early enemies
Floor 11–20
↓
Stronger enemies
Floor 21–30
↓
Advanced enemies
...
Floor 91–99
↓
Elite enemies
Floor 100
↓
Boss
The dungeon will control progression, while the enemy factory will handle enemy creation.
Dungeon
│
Current Floor
Enemy Pool
│
▼
Enemy Factory
│
▼
Enemy
│
▼
Battle
│
▼
XP / Gold / Loot
│
▼
Next Floor
This separation keeps the different systems responsible for different things.
The project supports both Make and CMake.
makeThen run:
./gameIf your Makefile provides a clean target:
make cleanfollowed by:
makeCreate a build directory:
mkdir build
cd buildConfigure the project:
cmake ..Build:
cmake --build .Then run the generated executable.
- C++ compiler with modern C++ support
g++orclang++- Make
- CMake
Recommended:
C++17 or newer
This project is also intended as a practical way to learn and experiment with C++.
Some of the concepts used include:
- Classes
- Inheritance
- Polymorphism
- Encapsulation
- Constructors
- Member functions
- Header/source separation
- Namespaces
- STL containers
std::vector- Factory pattern
- Random number generation
- Object-oriented game architecture
- CMake
- Makefiles
The main goal is to build a small but expandable RPG while learning how larger C++ projects are structured.
The intended gameplay loop is:
Create Character
↓
Enter Dungeon
↓
Fight Enemies
↓
Gain XP & Gold
↓
Level Up
↓
Become Stronger
↓
Progress Through Dungeon
↓
Fight Boss
↓
Reach Floor 100
The project will gradually expand as new systems are introduced.
This project is currently under active development.
| System | Status |
|---|---|
| Character | Completed |
| Player | Completed |
| Warrior | Completed |
| Samurai | Completed |
| Enemy | Completed |
| Enemy Factory | Completed |
| Battle | Completed |
| ASCII UI | Completed |
| Dungeon | In Development |
| Floor progression | In Development |
| Enemy scaling | In Development |
| Bosses | In Development |
| Inventory | Planned |
| Equipment | Planned |
| Loot | Planned |
| Save system | Planned |
- Character system
- Player system
- Player classes
- Enemy system
- Enemy factory
- Battle system
- Create dungeon system
- Create floor system
- Implement floors 1–100
- Floor-based enemy pools
- Enemy difficulty scaling
- Boss encounters
- Improved XP system
- Level progression
- Stats
- Skills
- Class abilities
- Inventory
- Weapons
- Armor
- Items
- Loot
- Shops
- Save/load
This project is currently a personal learning/development project.