American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

8 PM – Python OOP – Joel

December 1, 2024 @ 8:00 pm - 9:00 pm

Today we did:
  1. We continued with MonsterSystem and learned about overriding.

 

Homework:
  1. In the play_adventure_game method, after the user chooses a valid monster, after the if elif elif for the attack_selection, you need to make sure that if the player’s health is <= 0, you need to print “”<m.species> just killed you, thank you for playing this game.”, and break out of the loop.
  2. Make a new child class of the Monster (parent). It can be any monster you want (hydra, godzilla, anything). It needs to be associated to an element (that way it can be immune to that magic attack). Make a new element, add it to the magic attack menu, and in the magic_attack method, add an elif for that magic attack selection. For the new monster’s class, it needs to inherit from the Monster class (parent), needs to have the same constructor (type the species name when you call the super’s constructor), and make a receive magic attack similar to how we did for dragon, troll, etc. Finally, make sure to add it in the dictionary in the initialize_monsters method. Remember to import Monster into the child class, and also import the new child class into the MonsterSystem.

Details

Date:
December 1, 2024
Time:
8:00 pm - 9:00 pm
Verified by MonsterInsights