Question: Receiving XP ( 1 0 pts ) : When a hero defeats a monster, they receive XP . Every 1 0 points of XP a

Receiving XP (10 pts): When a hero defeats a monster, they receive XP. Every 10 points of XP a hero receives increases the hero's level by 1. Upon leveling up a hero's maximum hit points are increased by 5 and their hitPointsRemaining are reset to the new maximum. Create a method which takes an amount of received XP and updates the hero's currentXP (and currentLevel, hitPointsMax, and remainingHitPoints as necessary). Note: a hero may receive more than 10 points of XP at a time. Use the following method signature:
public void receiveXP(int xpReceived)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!