- This event has passed.
7 PM – Python OOP – Latisha
January 5, 2023 @ 7:00 pm - 8:00 pm
Today We Did
- We reviewed Class, Inheritance, methods, __init__.
- We reviewed how to override parent’s class method.
- We continued with AdventureGame project by adding “1. Add New Monster”
Homework
- Continue with AdventureGame project. Add code so it will do the following
- When the program first starts, add the following monsters automatically to the monster_dictionary
- Dragon – 100 health – 50 Max attack
- Troll – 50 health – 20 Max attack
- Water Golem – 30 health – 20 Max attack
- Cyclops – 60 health – 30 Max attack
- Add code to do “2. List all monsters” like below
-
Welcome to AYC Logic Adventure Game Main Menu 1. Add Monster 2. List all monsters 3. Play Adventure 4. Exit Enter your selection: 2 Dragon - 100 health - 50 Max attack Troll - 50 health - 20 Max attack Water Golem - 30 health - 20 Max attack Cyclops - 60 health - 30 Max attack Main Menu 1. Add Monster 2. List all monsters 3. Play Adventure 4. Exit Enter your selection: 1 ADD NEW MONSTER Enter monster species: Hydra Enter monster health: 80 Enter monster max attack: 40 You have succesfully added Hydra to our system. Main Menu 1. Add Monster 2. List all monsters 3. Play Adventure 4. Exit Enter your selection: 2 Dragon - 100 health - 50 Max attack Troll - 50 health - 20 Max attack Water Golem - 30 health - 20 Max attack Cyclops - 60 health - 30 Max attack Hydra - 80 health - 40 Max attack Main Menu 1. Add Monster 2. List all monsters 3. Play Adventure 4. Exit Enter your selection:
- When the program first starts, add the following monsters automatically to the monster_dictionary