I just cant figure out how to create a highscore function. I know that I have to have 2 values and compare them with an if statement and save them in SharedPreferences. Sharedpreferences I understand. What I cant understand is how to compare those 2 values?
In my program I have an int called score. It increases like score++ every time I answer a question correctly and at the end the answered question number is displayed. Lets say I play again and now get a larger number. How to compare them if their with the same name score? Do I need to assign the score to some new variable? how? I feel so dumb and emberresed right now..
Aucun commentaire:
Enregistrer un commentaire