This site requires JavaScript, please enable it in your browser!
Greenfoot back
Jtlie
Jtlie wrote ...

2014/1/16

Multiple Highscores

Jtlie Jtlie

2014/1/16

#
HI, I'm making a game with 4 minigames which have their own highscore. I know the Excel file has multiple scores but how do I change them. I already know how to change the first one but I don't want them to overwrite eachother
if (UserInfo.isStorageAvailable())
        {
            UserInfo Order_score = UserInfo.getMyInfo();
            if(punten > Order_score.getScore())
            {
                Order_score.setScore(punten);
                Order_score.store();
            }
            high_score = Order_score.getScore();
        }
        
bourne bourne

2014/1/16

#
Use the 10 general purpose ints. Where each minigame is associated with a different index. Using: getInt(int index) and setInt(int index, int value) You will have to do your own sorting since getTop and getNearby only consider the score field ( in that you might need to call getTop(max) where max is a large number in attempt to receive all data. Then the retrieved list could be sorted by a given int field )
You need to login to post a reply.