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

GameMaker room_restart() freezing the game.

I

ianduarte100

Guest
(English is not my native language, so ignore if something is wrong)

I'm trying to make my room restart when the character dies, but the game freezes instead. I put the function on the "home" button to see if it worked, but the game simply freeze the moment I press the button and it returns to normal when I release.

here is the code:

if keyboard_check(vk_home) {
room_restart();
}
 

YoSniper

Member
Use keyboard_check_released() instead of keyboard_check().
I'd recommend keyboard_check_pressed instead, but you'd essentially get the same result.

For context, keyboard_check returns true as long as the key is held down, so for every step that that key is held down (30x per second by default,) the room is restarting. To the human eye, this looks like a game freeze.
 
I

ianduarte100

Guest
I'd recommend keyboard_check_pressed instead, but you'd essentially get the same result.

For context, keyboard_check returns true as long as the key is held down, so for every step that that key is held down (30x per second by default,) the room is restarting. To the human eye, this looks like a game freeze.
both options did nothing.
 
I

ianduarte100

Guest
Ok, I just put the same code in another project and it worked out perfectly.
 
Top