I'm a bit confused how to do this without a million lines of code
In my game there's say 100 levels and on each level there are like x number of things to be destroyed
Say on level 1 there's 26 items and on level 2 there's 15
on level 1 you destroy 10 and move on to the next level, on level 2 you destroy 3 items
You can submit your score after any level
I need the variable (which will be stored in local storage I guess) to be the accumulation of these numbers i.e. 13 after completing level 2
If they go back and do level 1 and manage to destroy 15 items there overall score is now 18
What's the best way to store and update this kind of score variable?