American Young Coder Academy – Indo

Loading Events

« All Events

  • This event has passed.

6 PM to 8 PM – Python OOP – Gamas

April 5, 2023 @ 6:00 pm - 8:00 pm

Homework
  1. Similar to dragon.py, create troll.py, water_golem.py.
  2. Inside troll.py
    1. Create Troll class that inherits from Monster class.
    2. override magic_damage method so
      1. when Troll got hit by earth magic, it will say “Troll is immune to Earth magic. No damage is done.”
      2. when Troll got hit by fire magic, it will do half damage.
  3. Inside water_golem.py
    1. Create WaterGolem class that inherits from Monster class
    2. override magic_damage method so
      1. when WaterGolem got hit by water magic, it will say “Water golem is immune to water magic. No damage is done.”
      2. when WaterGolem got hit by fire magic, it will do double damage.
  4. Modify monster.py
    1. Add a new method sword_damage(self, attack_point). Inside the method do reduce the monster.health with attack_point.
    2. Change the main.sword_attack method to call this monster.sword_damage(player_attack).

Details

Date:
April 5, 2023
Time:
6:00 pm - 8:00 pm
Event Categories:
,
Verified by MonsterInsights