« All Events
6 PM – Python OOP – Shawn
January 2 @ 6:00 pm - 7:00 pm
Today We Did
- We continued with Monster Inheritance project.
- We utilized dictionary to translate from “1” to “fire”, “2” to “water” etc. And we utilized another dictionary to translate from “1” to 15 (fire magic damage), “2” to 15 (water magic damage) etc.
- We added code to make the magic attack to work.
Homework
- If you were not able to copy the codes completely, the Monster Inheritance codes can be found in https://drive.google.com/drive/u/0/folders/1zuuNL_dnmRkxMaInRAyDHwwyWPLXiYEr
- Inside main.py, the play_adventure method is too big now, almost 50 lines of codes. We need to break down this big method into smaller methods.
- You need to move sword attack related codes from play_adventure method into its own sword_attack method.
- And you need to move magic_attack related codes from play_adventure method into its own magic_attack method.
- Upload your codes into google drive.
- Next week we are going to learn how to do monster special behavior using inheritance.