Today I was able to implement a score multiplier system. We thought this would be essential for some variation for high scores if we want to include leaderboards.

Early implementation of HUD multiplier feedback
My next step for this is to set it up so that when the multiplier is not active (when it has a value of 1) it will be hidden.
Code (added to exisiting score manager code):
void Update()
{
if (PlayerDie.PlayerAlive == true && pauseGame.paused == false)
{
score = score + (scorescale * scoreMultiplier * Time.time); //score growth rate increases over time
//will add code to make score scale reset to 0 every time damage is taken.
TextScore = scoreScreen.GetComponent();
TextScore.text = Mathf.Floor(score).ToString();
Multiplier = scoreMultiplier;
//for public inspector feedback on multiplier
MultiplyScore.text = Mathf.Abs(scoreMultiplier).ToString("0.#");
ScoreMultiply();
//run score multiply control system
}
}
void ScoreMultiply()
{
if (scoreMultiplier > 1f && ResetOK == false)
{
ResetOK = true;
StartCoroutine (MultiplyReset());
}
}
IEnumerator MultiplyReset() //resets the multiplier to 0 after shooting no enemies for a certain amount of time
{
yield return new WaitForSeconds(MultiplierResetTime);
scoreMultiplier = 1f;
ResetOK = false;
}
Good Day,
I’m looking for a function similar to the leaderboard. Would you be able to advise on the coding?
Regards,
Kirsten Slater.
LikeLike
Hello,
I haven’t implemented a scoreboard system yet but I will do in the upcoming weeks, I’ll make a blog post about it with the code when I get to that part of my schedule.
Sorry I couldn’t be of much help.
Regards
Boma West
LikeLiked by 1 person