« All Events
10 AM – Intro To Java – Gamas
January 15, 2022 @ 10:00 am - 11:00 am
Today We Do
- We finished reducing the player’s health when attacking monster.
- We installed Android Studio.
Homework
- In Monster inheritance. add the monster healing feature. Inside Monster.java, add a method called “heal(int healingPoint)” . Use this new method when you are healing the monster. When you heal a monster, make sure the monster does not attack you. Look at below
-
What is your name: Gamas
How much health you want: 100
Gamas has 100 health remaining.
Please select one of the following monsters:
- troll - health remaining: 50
- dragon - health remaining: 100
- water golem - health remaining: 30
Enter your selection (Enter 'exit' to quit): troll
What do you want to do with the troll:
1. Magic attack
2. Melee attack
3. Arrow attack
4. Heal
Enter your selection:4
HEAL THE MONSTER troll
How much health points you want to heal: 50
After healing, troll now has 100 health points remaining.
Gamas has 100 health remaining.
Please select one of the following monsters:
- troll - health remaining: 100
- dragon - health remaining: 100
- water golem - health remaining: 30
Enter your selection (Enter 'exit' to quit):