I am making a game that generates diferrent scores every time its played, and i want to make a variable that holds the top score, the problem is i cant find away to store the last score without overwritting it with the new score generated everytime i open the scene again.
For example if a game is played in the end i will have a variable like score = 10
and i want to compare that "10" with score of the next game and if it´s superior i will update my "top score" variable with the new score
Currently my function is this:
var top_correct_s = 0
func top_score_s():
if(top_correct_s < Globals.get("ANSWERS_CORRECT_S")):
top_correct_s = Globals.get("ANSWERS_CORRECT_S")
R_top_S.set_text(str(top_correct_s)+str("/10"))
else:
R_top_S.set_text(str(top_correct_s)+str("/10"))
pass
thanks in advance