• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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