In the following example, I show you how to load numbers from an .ini file, determine if the current score is higher than any of the high scores, and then rewrite the .ini file accordingly.
To start with, create the ini file. To do so, open up Notepad and save it as "name.ini". In the following example, I named the file "dum.ini"
You can set the .ini up as such:
score1 = 0
score2 = 0
score3 = 0
score4 = 0
score5 = 0
What you have just done is created a file with 5 variables, each capable of holding high scores. Score1 will hold the highest, score2 will hold the second highest, etc, etc. NOTE THAT THE INI MUST BE IN THE SAME FOLDER AS THE GAME.
The following will require you to use GML, but I've set it up so that you can just copy/paste
the code into a control object.
In the Create Event:
ini_open("dum.ini")//opens the .ini file for the data to be read
score_grid=ds_grid_create(1,5)//creates a data grid that holds the values of the high scores
ds_grid_set(score_grid,0,0,ini_read_real('highscores','score1',''))//sets the values of the datagrid
ini_close()//close the .ini; this is important
game_score=0//the current players score
Put this code when the round has ended.
//sets up a while loop that checks the value of the current score with every single one of the high scores.
a=0 //the current ranking of the score being checked. it starts at 0 because data grid numbering starts at 0
while a<5 //while a<the number of items in the data grid
if game_score>ds_grid_get(score_grid,0,a)//if the score is higher than this number
//this code slides down all the values of the high scores. so if your score is
//the new highest score, score 5 is set to score 4, score 4 is set to score 3, etc.
break;//if you've run through all the numbers, QUIT
break;//if you've set the new score, QUIT
ini_open("dum.ini")//WRITE THE NEW VALUES TO INI FILE
Assuming you want to draw it, put this in the Draw Event.