Hello, I'm new to this and I wanted you to tell me how to make a score record, that is, when the player loses, a list of his current score is saved and then when he exceeds it, a new score appears
if(!UserInfo.isStorageAvailable()) {
System.err.println("Cannot save score!");
return -1;
}
UserInfo user = UserInfo.getMyInfo();
if(user.getScore() >= score)
return user.getScore();
user.setScore(score);
user.store();
return score;
public void storeArray(int[] array) {
UserInfo user = UserInfo.getMyInfo();
for(int i=0; i<array.length; i++)
user.setInt(array[i]);
user.store();
for(int i=0; i<array.length; i++)
user.setInt(array[i]);
user.store();
user.setInt(i, array[i]);