I have oController as the first object to run when the game is opened. In oController's Game Start event I have the following code:
ini_open(working_directory + "SavedScores.ini");
var highscores = ini_read_real("Highscores", "Score", 0);
ini_close();
global.LastScore = highscores;
When the player has gotten their score, I use this code to save it:
if global.gameOver {
if global.LastScore == 0 {
global.LastScore = global.currentScore;
ini_open(working_directory + "SavedScores.ini");
ini_write_real("Highscores", "Score", global.LastScore);
ini_close();
} else {
if global.currentScore > global.LastScore {
global.LastScore = global.currentScore;
ini_open(working_directory + "SavedScores.ini");
ini_write_real("Highscores", "Score", global.LastScore);
ini_close();
}
}
}
Whenever I relaunch the game on my phone, it won't load the score I got when I previously launched the game. Idk why it's not saving?