frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

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.

https://flowlab.io/game/play/376726

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.

ELSE:

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.
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

[email protected]

Get In Touch