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.

Homework

Re-Upload monster.py, troll.py, dragon.py, water_golem.py, and monster_system.py 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 self.health -= 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.

 

Notes

If you have any questions, email me at ddjapri@ayclogic.com !!

Details

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