I’m having a hard time understanding how to make the following scenario work. I’m trying to create a leaderboard of top 20 high scores for a game…
(1) Read the last (20th) score to see if it’s below the current score (aka a new high score has for sure been scored) - I can do this just fine.
(2) Once I’ve established a new high score has been scored, I want to write the new high score to the leaderboard. I can accomplish this too.
(3) Once new high score is written, I want to read the entire leaderboard and display it. I can do this as well.
However, these all execute in an overlapping manner and I want them to execute in order, in a synchronous manner. Currently, 1, 2, and 3 are being executed almost simultaneously. This is driving me absolutely crazy. I cannot find any good explanation on how to make this happen. Please, any insight would be VERY much appreciated.