Question by
Bluesharky38 · Aug 17, 2021 at 06:37 PM ·
scoreresetenablescore systempowerbar
Resetting Power up bar
So for my game I want to have a power up bar that will reset once it reaches a score of 100 which would then enable a power up on the player. I have made the power up bar and it fills up when the player scores.
Here is my code for the adding to the score which increases the bar
public void AddScore()
{
currentPower += 10;
_score += 10;
_powerUpbar.SetBar(currentPower);
}
What I need to know now is how do a make the score reset to zero after it is greater than or equal to 100. After that how can I make a power up that's attached to the player become enabled?
Comment