• 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!

Help me please! Game Maker

KootGok

Member
I'm still working on my game. But ANOTHER PROBLEM arose. What happens is that I have two GLOBAL VARIABLESl. Score and another global. HiScore. The latter supposedly has to show the highest score obtained, and above all, when the score is lower, it must stop adding until it exceeds it. That's what I'm trying to do. I have searched the internet even in English forums but I could not find anyone who has the same concern as me. The code I am trying to fit into the STEP event of the HiGHSCORE is as follows:

if global. Score <global. HiScore {global. HiScore (it has to stop adding if that happens); }

I hope someone helps me!
 

Roldy

Member
I'm still working on my game. But ANOTHER PROBLEM arose. What happens is that I have two GLOBAL VARIABLESl. Score and another global. HiScore. The latter supposedly has to show the highest score obtained, and above all, when the score is lower, it must stop adding until it exceeds it. That's what I'm trying to do. I have searched the internet even in English forums but I could not find anyone who has the same concern as me. The code I am trying to fit into the STEP event of the HiGHSCORE is as follows:

if global. Score <global. HiScore {global. HiScore (it has to stop adding if that happens); }

I hope someone helps me!
Have you tried doing it like:

GML:
if (global.Score > global.HiScore) {
    global.HiScore = global.Score;  // We only update the high score when the current score is greater
}
 

KootGok

Member
Have you tried doing it like:

GML:
if (global.Score > global.HiScore) {
    global.HiScore = global.Score;  // We only update the high score when the current score is greater
}
IT HELP ME!!!. THANKS! Now the highscore only update when the score is greater! :)
 
Top