Skip to content

lucascruzjoubi-dev/text-rpg-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-Based RPG (C++)

📖 Description

A console-based RPG developed in C++ with a focus on clean architecture, object-oriented design, and core game systems.
This project was built to practice real-world C++ development concepts such as inheritance, file I/O, debugging, and system design.


🎮 Features

  • Turn-based combat system
  • Player and enemy entities
  • Inventory and item usage
  • Save and load game state using file serialization
  • Clean OOP design with a shared Character base class
  • Modular code structure with header/source separation

🧱 Project Structure

text-rpg-cpp/ │ ├── main.cpp ├── Game.h / Game.cpp ├── Character.h / Character.cpp ├── Player.h / Player.cpp ├── Enemy.h / Enemy.cpp ├── Item.h / Item.cpp ├── .gitignore └── README.md


⚙️ Build & Run

Requirements

  • C++17 compatible compiler (tested with g++ / MinGW)
  • Windows (other platforms may require small adjustments)

Build

``bash g++ main.cpp Game.cpp Player.cpp Enemy.cpp Item.cpp Character.cpp -o TextRPG

Run TextRPG

💾Save System

The game supports saving and loading progress:

Player HP

Inventory items

Data is stored in a simple text file (save.txt) for clarity and learning purposes.

🧠 What I Learned

C++ object-oriented programming and inheritance

Header/source file organization

Game loop architecture

File I/O and basic serialization

Debugging compiler and linker errors

Refactoring code safely without breaking functionality

Using Git and GitHub for version control

🚀 Possible Improvements

Experience and leveling system

Multiple enemies and encounters

Better input validation and menus

Data-driven configuration (JSON / external files)

Graphical version using SFML or SDL

👤 Author

Lucas
Game Development student (Brazil)
Focused on C++, game systems, and gameplay architecture

About

Console-based RPG in C++ with clean architecture and save/load system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages