Hi, I have been trying to save the game.credit using the UserInfo.class :
And it works: I can earn money ingame and re-compile the game again and again, the money I earned is saved. But when I close the who.e Scenario (When I exit Greenfoot) and re-open my project, all the datas are gone... is the method i'm using not useful in that case or is there something wrong in its code? Could you help me please?
public static void store()
{
if (UserInfo.isStorageAvailable())
{
UserInfo myInfo = UserInfo.getMyInfo();
myInfo.setInt(0, Store.wealth);
}
}public void load()
{
if (UserInfo.isStorageAvailable())
{
UserInfo myInfo = UserInfo.getMyInfo();
previousWealth = myInfo.getInt(0);
}
}
