My first Python code
As I'm working through the Python Basics course on RealPython.com this was my first real excercise.
I've been doing small funtional tests up until now, but this consolidates the subjects so far in the course.
There will be much more elegant way to solve this in the future I'm sure. Making objects and actions, but I'm very satisfied with the working result, that also covered the stretch goals.
Write a text-based role-playing game (RPG) with the following features: • The game involves one player and one monster. • The player begins with 100 health, while the monster starts with 150 health. • The player has the options to attack, heal, or run away. • If the player attacks, they deal between 10 and 15 damage to the monster. • If the player heals, they regain 30 health, but can't exceed a maximum of 100 . • If the player runs away, the game concludes. • After the player's turn, if the monster is still alive, it deals between 15 and 20 damage to the player. The game continues until the health of either the player or the monster reaches 0, or until the player decides to run
Stretch Goals
• Prevent the player from exiting the game by pressing an to.
• Introduce double-damage critical hits that occur when an attack value is amultiple of 3. # I did actually make this a triple-damage hit. Players like to win occasionally
• Use emojis or string formatting syntax to make the game output more enjoyable