A
Ambition13z
Guest
I am trying to make a simple High Score that is saved even after closing the game (its an asteroids type game). Right now when the player ship gets blown up, you transfer to the High Score room. In there you will see two scores, where one says what your final Score was. The other is the high score. I was trying to figure out how to save the high score only. here is my code for drawing the high score:
//Score Draw
draw_set_color(c_white);
draw_set_halign(fa_center);
draw_set_valign(fa_top);
draw_set_font(fnt_mid);
draw_text(300,200,"Final Score: " + string(global.points));
if (global.points > global.final)
{
global.final = global.points;
draw_text(300,270,"High Score: " + string(global.final));
}
else
{
draw_text(300,270,"High Score: " + string(global.final));
}
Everything shows up fine, except for the final score always being the high score (due to the high score never saving).
//Score Draw
draw_set_color(c_white);
draw_set_halign(fa_center);
draw_set_valign(fa_top);
draw_set_font(fnt_mid);
draw_text(300,200,"Final Score: " + string(global.points));
if (global.points > global.final)
{
global.final = global.points;
draw_text(300,270,"High Score: " + string(global.final));
}
else
{
draw_text(300,270,"High Score: " + string(global.final));
}
Everything shows up fine, except for the final score always being the high score (due to the high score never saving).