A turn-based, command-line Role-Playing Game (RPG) built with a modular architecture in Python.
This project is a text-based RPG designed to run within the terminal/console. The structure is modular, which facilitates easy expansion and the addition of new features such as new events, items, and enemy types in the future.
- Turn-Based Combat: Includes logic for critical hit chance and dodging.
- Progression System: Levels, Experience Points (XP), and automatic player stat increases upon leveling up.
- Random Events: Traps, healing finds, mini-quests with trade-offs, and sudden enemy encounters.
- Shop: Allows the player to buy potions and permanent stat upgrades that apply immediately.
- Save/Load: Uses JSON files (
player.json) to persist player progress.
| File | Description |
|---|---|
main.py |
The main game loop, menu, and navigation between modules. |
fight.py |
All combat logic (attack, HP check, reward distribution). |
events.py |
Handles random events that trigger during the adventure mode. |
shop.py |
Contains the store logic (displaying items and handling purchases). |
items.py |
The catalog of all available items and their effects. |
level.py |
Logic for leveling up, granting XP, and displaying player statistics. |
data.py |
Holds the default data structures for the player and other entities. |
storage.py |
Functions for saving and loading player data to/from JSON. |
Python 3.x is required to run the game.
- Clone the repository:
git clone https://github.com/WR36/Python-Console-RPG.git cd python-console-rpg - Run the main file:
(A new save file,
python main.py
player.json, will be automatically created upon the first run).
Currently implemented features include:
- Core player stats:
hp,max_hp,gold,damage,xp,level,crit_chance, anddodge_chance. - Shop functionality (items apply effects immediately; no inventory slots yet).
- Combat and random event logic.
Planned Features: A more complex inventory system, quests, and distinct area maps.
If you have ideas for improvements or find a bug, feel free to open an Issue or submit a Pull Request!
To continue development, please confirm you will use this content in a README.md file, and let's get back to fixing the two critical code issues that prevent your game from running:
- Update
data.py(to define the missing stats). - Fix
main.py(to handle enemy generation).
Would you like to start with updating data.py now?