American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

4:30pm – Python OOP – Roland

May 16 @ 4:30 pm - 5:30 pm

Today We Did

  1. Continued working on MonsterInheritance Project
    1. Dragon Class
    2. Started the MonsterSystem
      1. Initialization
      2. Application Loop Menu
        1. Add monsters
        2. List all monsters
        3. Started working on the adventure game

Homework

Continue working on the MonsterInheritance project, implement the WaterGolem class in a new file called watergolem.py following the instructions below:

  1. WaterGolem should inherit from Monster
  2. __init__
    1. Should take in 2 attributes: health, max_attack
    2. Call super() with “water golem” as the species type, and the two attributes passed in
  3. Override receive_magic_attack
    1. If the magic_type is “fire” then print “Water Golem is immune to fire. Therefore, the water golem suffer no damage” and DO NOTHING ELSE
    2. If the magic_type is “water” then print “Water Golem is resistance to water. Therefore, the water golem only takes half the damage!
      1. Call receive_magic_attack from the parent with HALF THE DAMAGE and magic_type passed in!
        1. Refer to #3 below if you need a hint on how to do this
    3. If the magic_type is anything ELSE, then user super() to call receive_magic_attack from the parent with the damage and magic_type passed in
      1. hint: super().receive_magic_attack…

If you have any questions, feel free to email me at rolandyang@ayclogic.com

Details

Date:
May 16
Time:
4:30 pm - 5:30 pm
Verified by MonsterInsights