« All Events
9 AM – Intro To Java – Gamas
July 30, 2022 @ 9:00 am - 10:00 am
Today We Did
- We continued with the Monster Inheritance project.
- We added codes in Dragon class to override magic damage so if a player attack Dragon with a Fire magic attack, then it will display a message saying “Dragon is immune to fire magic attack. No damage is done.”.
Homework
- Continue with Monster Inheritance project. Add Troll.java class and override doMagicDamage(String magicType, int damage) so when magicType is equal to “earth” it will display a warning message “Troll is immune to earth magic attack. No damage is done.”
- Inside MonsterInheritanceMain.java. Specifically inside initializeMonster, use Troll class when adding Troll to the map.
- Run the program and see if you attack Troll with earth magic if it display the above message.