« All Events
9 AM – Python OOP – Indo – Gamas
January 20 @ 9:00 am - 10:00 am
Today We Did
- We continued with Monster Inheritance project.
- We added sword and magic attack
- We added monster.sword_attack(self, damage)
- We added monster_attack_player(self, monster) method.
- We added the fire and water magic attack
Homework
- Similar to monster.sword_attack(self, damage), create a new method inside monster.py magic_attack(self, damage, magic_type)
- After you created monster.magic_attack() method, you have to call it from main.py where the player attack the monster with magic attack.
- copy codes from page 168 to 169. Do it in a file called inheritance_hw_1.py.