High Score Rig

Now, a lot of people have wondered “how do I make a high score tracker?”

When the save behavior first came out I immediately got around to this question.

I made this game to tinker with saving, then came up with the standard rig.


The way it works is simple:

It takes the high score, and subtracts the previous score from it. If the difference is below 0, then the previous score must be greater than the existing high score. It then saves the previous score as the new high score.

For example.

Previous score: 14
High score: 7

7 - 14 = (-7); 0 > (-7)

This means the high score has been broken, and the previous score should become the new high.


Previous score: 55
High score: 60

60 - 55 = 5; 0 < 5

The previous score was not quite high enough to break the high score. So the high score is displayed like normal.