A Level RPG Programming Challenge
A Level RPG Programming Challenge
RPG
Scenario:
Your challenge is to create a text-based RPG simulator where players choose and
control characters to battle until one is defeated. Characters can attack, take damage,
and use class-based special abilities. You can decide the setting - this could be a
magical land, the ocean, outer space etc. and the story behind the game.
Challenge Objectives:
Essential Tasks:
Define a Character Class
- Include attributes for name, class_type, health, and strength.
Add a method to take damage
- Create a take_damage(self, damage) method that reduces health by a given
amount.
- Ensure health never drops below zero.
Create at least two characters
- Instantiate two characters with different names, classes, health, and strength
values.
- Display their initial status.
Extension Tasks:
Difficulty levels
- Add a function to set "Easy", "Medium", or "Hard" modes.
- Adjust characters’ health and strength based on difficulty.
Special abilities
- Each class should have a unique ability (e.g., Warrior can block damage, Mage can
cast a fireball).
- Use input to allow players to trigger abilities.
Critical hits
- Add a 20% chance to do extra damage during any attack.
- Use random.random() and random.randint().
Combat history log
- Store each action (e.g., attack or ability use) in a list.
- Display the full combat log at the end of the game.