#define HIGH_SCORE_SAVE_FILE "hs.score"
TEXT* input_file = { strings = 1; } // used to load saved information, only one string needed
void load_highscore()
{
txt_load(input_file, HIGH_SCORE_SAVE_FILE);
wait(1); // wait one frame to load the text file - important!
hscore_count = str_to_float( (input_file.pstring)[0] ); // (<text>.pstring) [ line, beginning with 0! ] -> convert to float
}
void save_highscore()
{
var file_handle = file_open_write(HIGH_SCORE_SAVE_FILE);
wait(1); // wait to open the file?? - not sure if this is needed
file_str_write(file_handle, str_for_float(NULL, (double)hscore_count)); // convert the highscore to a string -> write into file
file_close(file_handle);
}