- This event has passed.
5 PM – Python OOP – Bill
July 19, 2022 @ 5:00 pm - 6:00 pm
Gamas substitute
Today We Do
- We finished with the Book system.
Homework
- Create a new project in Pycharm “MonsterInheritance”. If you are having problem creating a new Pycharm project, no worries, you can do this homework inside Book System project
- Create a new file monster.py. Inside the file, create a new Monster class with the following attributes:
- species
- health
- max_attack
- Inside Monster class, create a new method get_info(self) which will RETURN (not print) like this “<species> – <health> healths – <max_attack> Max attack points.”
- Create a new file monster_system.py. Inside create MonsterSystem class.
- Inside MonsterSystem class, create application_loop(self) which will continuously display the following menu and get input from user. If user enter “exit”, stop the loop.
- Call the MonsterSystem application_loop method to run the program.
-
Welcome to AYCLOGIC Adventure game. 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): asdfasdf You have entered an invalid selection. Please try again 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): exit Thank you for playing AYCLOGIC Monster Adventure