- This event has passed.
4 PM – Intro To Java – William
February 17 @ 4:00 pm - 5:00 pm
Today We Did
- Finished implementing Sword attack
- Attack menu
- swordAttack()
- takeDamage()
- Explained inheritance (superclass, subclass):
- Created Monster.java
Homework
Continue working on MonsterInheritance:
- Check if the player has died. If so, return to the main menu:
What do you want to do with the Troll: 1. Magic attack 2. Sword attack 3. Arrow attack 4. Heal Monster Enter your selection: 2 You attacked the Troll for 50 damage. It has 30 health remaining. The Troll attacked the player for 38 damage. Game Over! You were killed by Troll. Please select from one of the following 1. Add new monster 2. List all monsters 3. Play the game Enter your selection (enter "exit" to quit):
- Add the menu for magic attack:
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:
- Arrow attacks damage monsters from a distance! They deal 10 base damage, with a 20% critical hit chance to do 2x damage. Monsters are unable to fight back 🙂
- Normal attack:
What do you want to do with the Troll: 1. Magic attack 2. Sword attack 3. Arrow attack 4. Heal Monster Enter your selection: 3 ARROW ATTACK MONSTER You shot Troll for 10 damage.
- Normal attack:
- Critical hit:
What do you want to do with the Troll: 1. Magic attack 2. Sword attack 3. Arrow attack 4. Heal Monster Enter your selection: 3 ARROW ATTACK MONSTER Critical hit! You shot Troll for 20 damage.
- Critical hit:
If you have any questions, please email me at williamsmith@ayclogic.com.