- This event has passed.
4 PM – Intro To Java – William
February 24 @ 4:00 pm - 5:00 pm
Today We Did
- Checked player death
- Implemented arrow attack
- Started implementing magic attack
- Added fire immunity to Dragon using an overridden method
Homework
Continue working on MonsterInheritance:
- Implement the magic attacks in the main class using takeMagicDamage()
- Create a new Troll class that is a subclass of Dragon. Trolls are immune to earth magic:
What do you want to do with the Troll: 1. Magic attack 2. Sword attack 3. Arrow attack 4. Heal Monster Enter your selection: 1 MAGIC ATTACK MONSTER Select your magic attack for Troll: 1. Fire magic - 10 damage 2. Water magic - 10 damage 3. Earth magic - 12 damage 4. Wind magic - 8 damage Enter your selection: 3 Troll is immune to earth magic! No damage dealt.
If you have any questions, please email me at williamsmith@ayclogic.com.