American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Python OOP – Darin

January 15 @ 5:00 pm - 6:00 pm

Today We Did

  1. Continued the Monster Inheritance project, where now we are able to fight the monsters by playing as a character we created by making a self.player_name and self.player_health attribute in the monster_system file.
  2. Created the functionality to do sword damage to the monsters of our choosing, and reduce their health.


Re-Upload,,,, and into your folder called MonsterInheritance on the google drive.

  1. Continue on your MonsterInheritance Project, finishing the magic attacks as shown below:
  2. You need to edit the individual special monster classes, where each monster is resistant to different types of magic. For reference:
    Dragon is immune to fire
    Troll is immune to earth
    Water Golem immune is resistant to water
  3. In the else statement inside of the receive_magic_attack() method of each special monster class, use this:
    super().receive_magic_attack(damage_point, magic_type)

    instead of -= magic_attack

    This allows you to call the method of the parent class (so you would call the normal receive_magic_attack from the parent Monster class)

  4. After this, make it so that the player gets attacked in the magic_attack method of the MonsterSystem class, similar to in the sword_attack() method. Add an else statement to show if the magic attack selection is invalid.
  5. Finally, add some code in the application_loop() method to print out a message saying that the monster has just killed you if the player health is less than 0.



If you have any questions, email me at !!


January 15
5:00 pm - 6:00 pm
Event Categories:
Verified by MonsterInsights