M
Matt93
Guest
I'm trying to do something really simple, but have never used ini files before so can't work it out.
When the player loses all their lives, their score saves to an ini file:
I only want this to overwrite the previous score if it is higher though, as as the moment it just writes the most recent score. I know this will be a really simple solution, but any help with this would be useful. Cheers!
When the player loses all their lives, their score saves to an ini file:
Code:
if (lives < 1) {
if (file_exists("Save.sav")) file_delete("Save.sav");
ini_open("Save.sav"); //opens file for writing and reading. If doesn't exist, Game Maker creates it
var highscore = score;
ini_write_real("Save1", "score", highscore);
ini_close();
}