Loading Events

« All Events

  • This event has passed.

5:30 PM – Python OOP – Gamas

October 12 @ 5:30 pm - 6:30 pm
Today We Did
  1. We continued with Monster Inheritance.
    1. We added Water Golem and Stone Golem classes into monster_system.py
    2. We learned how to remove code duplication using inheritance.
Homework
  1. Change code inside monster_system.py so when player’s health <= 0,
    1. say “The player run out of health. The game is finished.”
    2. Also mention how many monster the player has slayed. For example, the player has killed dragon and water golem. “The player has slayed 2 monsters.” . Hint – You need to have for loop.
    3. exit from the game.
  2. Change code inside monster_system.py, so it will display monster as dead when its health <= 0. For example, instead of display “- Stone Golem – -2 health – 20 minimum damage – 50 maximum damage” , it should display “- Stone Golem is dead.”. Hint you need to change the code inside view_all_monster method.
  3. Make sure inside dragon.py, stone_golem.py and water_golem.py, after special behavior, it will have
    print(f"The {self.species} now has {self.health} health remaining.")
  4. Modify dragon.py and stone_golem.py so when it is attacked by sword, it will say, “dragon is immune from sword attack. No damage is done.” . If possible create a new method inside monster.py, dragon.py and stone_golem.py

Details

  • Date: October 12
  • Time:
    5:30 pm - 6:30 pm