Hello. I want to have it where I can save the last score of the game, but every time I try load a variable I get 0.
Here is the code.
Room_1
If A == true
If Button Press Newpress;A
Set Variable A;false
Set Sprite Frame 0;0;PA_RandMinMax(1,3)
Set Variable Score;Score+1
End If
End If
If B == true
If Button Press Newpress;B
Set Variable B;false
Set Variable Score;Score+1
Set Sprite Frame 0;0;PA_RandMinMax(2,3)
End If
End If
If X == true
If Button Press Newpress;X
Set Variable X;false
Set Sprite Frame 0;0;PA_RandMinMax(0,1)
Set Variable Score;Score+1
End If
End If
If Y == true
If Button Press Newpress;Y
Set Variable Y;false
Set Sprite Frame 0;0;PA_RandMinMax(0,2)
Set Variable Score;Score+1
End If
End If
If PA_GetSpriteAnimFrame(0,0) == 0
Set Variable A;true
End If
If PA_GetSpriteAnimFrame(0,0) == 1
Set Variable B;true
End If
If PA_GetSpriteAnimFrame(0,0) == 2
Set Variable X;true
End If
If PA_GetSpriteAnimFrame(0,0) == 3
Set Variable Y;true
End If
Draw Variable 1;12;11;Score
Declare Global timer;Whole Number;60*60
Set Variable timer;timer-1
If (timer) <= 0
Switch Room Room_2
End If
Draw Variable 1;11;3;timer/60
Declare Global Score;Whole Number;0
Declare Global ScoreSaved;Whole Number;0
Room_2
Output Text 1;5;16;You got
Draw Variable 1;13;16;Score
Output Text 1;17;16;points!
Draw Variable 0;10;12;ScoreSaved
If ScoreSaved == 0
Set Variable ScoreSaved;Score
End If
If Sprite Touched 0
Save Variable ScoreSaved
End If
If !ScoreSaved == 0
Load Variable ScoreSaved
Set Variable ScoreSaved;ScoreSaved
End If
Thanks! I'm going to delete the code in 3 days from this post.
