- This event has passed.
4:30 PM – Python OOP – Gamas
April 19, 2022 @ 4:30 pm - 5:30 pm
Today We Do
- We reviewed how to get Monster object out of the dictionary.
- We reviewed how to pass Monster object from one method to another.
Homework
- Continue on MonsterInheritance project.
- When monster’s health is 0 or less, remove from the menu
- When player’s health is 0 or less, end the game
- Add the code for the magic attack menu
-
Dragon - -3 health - 50 Max attack Troll - 50 health - 20 Max attack Water Golem - 30 health - 20 Max attack Cyclops - 60 health - 30 Max attack Enter your selection ('exit' to quit): troll What do you want to do with the troll COMBAT MENU 1. Magic attack 2. Sword attack - 10 to 20 damage Enter your selection: 1 What kind of magic attack you want to do: 1. Fire magic - Max damage: 50 2. Water magic - Max damage: 50 3. Earth magic - Max damage: 65 4. Wind magic - Max damage: 40 Enter your selection: 1 You attacked TROLL with 18 damage and the TROLL has 82 health remaining. Dragon attacked you with 48 damage. Your remaining health is 152.