Explorer
Class
n
If
stamina
reaches 0, an explorer
is defeated.
n
One possible solution:
n
public void
takeHit (
int
hitStrength){
n
if
(hitStrength <= staminaPoints)
n
staminaPoints = staminaPoints -
hitStrength;
n
}
n
But this rarely lets the
staminaPoints
reach zero.