Saving Scores: Mostly Complete

The scoring system now can save to disk, and each level has its own save file.  I have only tested on my Windows PC, need to try on my android device next.  In theory it should work.  We’ll see.

The one issue I have with it is that if you have a new score that equals another older score (but can push down an even lesser score), it will push down the lesser score, but it appends itself AFTER the 1st score that is equal to it:

(Pretending I have a max of 3 on the table – I really have 10, but for simplicity’s sake):

Dave 40,

Bob 30,

Joe 20.

—————

Jim just got 30.

—————

The list should be :
Dave 40

Jim 30

Bob 30

 

But it actually renders as:

Dave 40

Bob 30

Jim 30

 

Joe is pushed off as he should be, but the older high score remains above the newer one.  Perhaps that’s as it should be.  But I feel like the newer one should take precedence.  I suppose I could also try to sort by name as a secondary sort after score.  But since people type in their name, then they can just choose to be AAA or whatever.

I’ll have to look into score sorting and see how other games do it – I don’t think I really paid much attention to that detail before.

Leave a Reply

Your email address will not be published. Required fields are marked *