Hi im trying to save high score after you close te game and read it when you open the application again
I use
Write Score in “high_score” of storage “save”
to save abd
Read “high_score” from storage “save” ans store value in Score
IÇ compile for Android but nothing is retrieved, any ideas?
Not sure if you’re writing it as shown in the IDE, but it should be:
Write Variable(Score) in “high_score” of file “save”
Note the “Variable(Save)” instead “Save”, if Save is a global variable use “GlobalVariable(Score)” instead.
For loading it’s ok, you’ve to pass the variable name only (Score), this will read the value from the file and store it in a scene variable Score, if Score is a global variable you can add the next action after the action to read the value:
Do = Variable(Score) to the global variable Score
I.e read the value from the file and store it in a scene variable Score, and then copy the value of Score into a global variable with the same name. The scene variable would be just an intermediary, it can have any name actually.
If the suggested changes don’t work take a screenshot of the events and share it here, maybe the logic has a little mistake
That was the problem ,thanks
The Variable statement on the write function was missing
But what happens when there is nothing stored and I try to read?, for example the first time you run the game.