- This event has passed.
5 PM – Intro to Java – William
August 1, 2023 @ 4:00 pm - 6:00 pm
Today we did:
- Reviewed Quiz and homework
- Continued MonsterInheritance project:
- initializeMonsters()
- addNewMonster()
- play()
- healMonster()
- meleeAttack()
- Started arrowAttack()
Homework:
- Finish arrowAttack()
- If monster has no more HP, print: “The (monster species) has been defeated”
- Player doesn’t take damage (since it’s a ranged attack)
- Start magicAttack()
- Implement the fire and water magic attacks
- The monster will do their max attack damage to player
- Implement your code however you want — I’ll critique it next lesson. Good luck!
NOTE: Add scanner.nextLine()
on a new line each time you use scanner.nextInt()
.
What do you want to do with the Troll: 1. Magic attack 2. Melee attack 3. Arrow attack (5 -10 damage) 4. Heal Enter your selection: 1 MAGIC ATTACK MONSTER What kind of magic attack you want to do to Troll: 1. Fire magic - 10 damage 2. Water magic - 10 damage 3. Earth magic - 12 damage 4. Wind magic - 8 damage Enter your selection: 1 You attacked Troll and did 10. Troll has 60 health remaining. Troll attacked Will Smith and did 37 damage. Will Smith has 963 health remaining. Please select one of the following monsters: - Troll - 60 health - Dragon - 100 health - Water Golem - 50 health Enter your selection (Enter 'stop' to end the game): Troll What do you want to do with the Troll: 1. Magic attack 2. Melee attack 3. Arrow attack (5 -10 damage) 4. Heal Enter your selection: 1 MAGIC ATTACK MONSTER What kind of magic attack you want to do to Troll: 1. Fire magic - 10 damage 2. Water magic - 10 damage 3. Earth magic - 12 damage 4. Wind magic - 8 damage Enter your selection: 2 You attacked Troll and did 10 damage. The Troll has 50 health remaining. Troll attacked Will Smith and did 53 damage. Will Smith has 910 health remaining. Please select one of the following monsters: - Troll - 52 health - Dragon - 100 health - Water Golem - 50 health Enter your selection (Enter 'stop' to end the game):
If you have any questions, please email me at williamsmith@ayclogic.com