Basic Python RPG
First attempt at a solo Python project — with minimal knowledge of anything past loops.
A short, terminal-based duel against an ogre. You name your hero, draw your sword, and fight turn by turn until someone hits zero HP. No frameworks. No classes. Just Python, random, and a stubborn willingness to see what happens when you mash 1, 2, and 3.
The pitch
You’ve barely escaped an ogre’s lunge. Your sword is out. The only question left is whether you swing hard enough — or heal at the wrong moment and get flattened.
This isn’t a sprawling open-world epic. It’s a single fight, built as a first real solo project: loops, conditionals, input, and a little randomness. And that’s the point.
Features
Move
What it does
Attack
Deal 15–20 damage to the ogre
Block
Cut the ogre’s next hit in half
Heal
Restore 5–10 HP
Turn-based combat (you act, then the ogre acts)
Randomized damage and healing so rematches stay interesting
Win / lose endings when HP hits zero
Runs in any terminal with Python 3
How to play
Make sure Python 3 is installed.
From this folder, run:
python3 RPG_basic.py
Enter your name when prompted.
Each turn, pick an action:
- Attack
- Block
- Heal
Survive the ogre. Celebrate. Or don’t. Then run it again.
Project layout
. ├── RPG_basic.py # The whole game — one file, one fight └── README.md # You are here
Why this exists
This repo is a snapshot of starting out: learning past “hello world,” past loops, and into something you can actually play. The code is simple on purpose. The ambition was never polish — it was finishing a game that reacts when you type.
If you’re new to Python and staring at a blank file wondering where to begin: a tiny RPG like this is a great first boss fight.
Requirements
Python 3.x
A terminal
Courage (optional, but recommended)
License
This is a learning project. Fork it, break it, add a dragon — make it yours.