Hi. I searched for this for a few days and haven't yet found an answer. I have my game set up so it will show the high score on each level when playing the level. My localstorage is "highscore" &layoutname. I have my level layouts in a level folder and are named 1,2,3, etc. All that works.
But what I want to add is a total of the high scores on the level select screen. For example, if I get a score of 10 on level 1 and 20 on level 2, the total score will say 30. If I go back to level 1 and get a score of 11, the total score should say 31 not 41. I don't know how to load all the high scores from all the levels and then add them together to show the total score. I can't figure out what code to write.
Is there a way to get localstorage of the high scores from all the levels then add them together so I can set the text to display the total score? I would be grateful for any help on this.