« All Events
4:30 PM – Python OOP
April 12, 2022 @ 4:30 pm - 5:30 pm
Homework
- Continue on Monster Inheritance project. We want to display attack menu after user enter a monster species in the main menu. Afterward, if user enter sword attack, do a random damage against the monster between 10 to 20 damage. The monster will also do some damage to the playerHealth. The monster damage would be between 10 to monster.maxDamage
- Look at example below
Your have 200 health remaining.
Please choose your monster:
Troll - 50 healths - 30 Max attack points.
Water Golem - 30 healths - 20 Max attack points.
Dragon - 100 healths - 50 Max attack points.
Enter your selection (enter "exit" to quit): dragon
What do you want to do with the Dragon
1. Magic attack
2. Sword attack - 10 to 20 damage
Enter your selection: 2
You attacked Dragon with 12 damage and the Dragon has 88 health remaining.
Dragon attacked you with 18 damage. Your remaining health is 182.
Your have 182 health remaining.
Please choose your monster:
Troll - 50 healths - 30 Max attack points.
Water Golem - 30 healths - 20 Max attack points.
Dragon - 88 healths - 50 Max attack points.
Enter your selection (enter "exit" to quit):