• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Brand spanking new



Hey all,

Just got GMS2 and while it's not my first time coding I'm pretty out of practice and will probably be on here a lot haha. I just completed the tutorial but wanted to add my own little flair to it: an end screen that tells you your final score and lets you replay the game by pressing enter. I managed to get most of it done by myself but I'm having trouble figuring out how to put the final score on the last screen. I've tried a few methods but most come back with an error or, at best, the last page comes up but the score is not displayed. Could someone help me or at least link a tutorial on how to do this? I'm really excited to start learning how this all works but I don't exactly know what to even search for so I'm hoping someone can help me out! Thank you :)


Assume that you have a font named fnt_final_score, an object named obj_final_score and the score in global.points. Then all you need to do is this in obj_final_score's Draw event:
draw_text(x, y, "Your final score is: " + string(global.points));
Then put an instance of obj_final_score in the last room, done deal.

You need to redo that tutorial, because chances are there would be similar code elsewhere in it (e.g. HUD) and you're not paying enough attention.