I am trying to save the Highest Score for a player via Webstorage. The problem I am having though is that I don't want the player's score to overwrite the Highest Score unless the score is actually higher than the Highest Score value.
So say the player is playing the game and on the first run through, they get 20 points. I want to save this to webstorage (I can do this no problem).
Say the player plays again and gets 25 points. I want this to save to webstorage.
If the player plays again but only gets 15 points, I do not want it saved to webstorage because it is less than the 25 previously earned - basically I want to keep track of the player's absolute highest score.
I am having difficulty doing this. Any tips would be quite welcome! Thank you.