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

2014/1/24

High scores don't save when i export my game

Jtlie Jtlie

2014/1/24

#
Hi, When I export my game as a application, the high scores don't work anymore. They do when I open the game with greenfoot. Please help :(
bourne bourne

2014/1/24

#
Are you using the UserInfo class? (UserInfo is designed for Users from the website, it only works in the IDE for testing) Otherwise, if you are saving to a file, I don't think the contents of a jar file can be manipulated. You could save files outside the jar directory though.
Jtlie Jtlie

2014/1/24

#
I'm using the UserInfo class. What other method should I use ?
1
2
3
4
5
6
7
8
9
10
if (UserInfo.isStorageAvailable())
        {
            UserInfo Order_score = UserInfo.getMyInfo();
            if(punten > Order_score.getInt(0))
            {
                Order_score.setInt(0, punten);
                Order_score.store();
            }
            high_score = Order_score.getInt(0);
        }
You need to login to post a reply.