Nuclear Detergent
Member
So I'm fairly new to GMS2 programming. I have a strange bug. Here's the code:
I want the player input to be locked, when the arrowkey up is pushed. So I have a variable that controls whether or not input can be made, if the arrowkey up is pressed or not. It works perfectly fine, except it dosen't. If no other input is given, when the game starts, and the arrowkey up is held for more than 4 seconds, and then released, the player object dissapears. If other inputs are given before holding the up key, it takes roughly 8 seconds for the player object to dissapear.
This is fairly odd. I have different speeds on my sprites - could this be the cause of the problem, or does anyone have any other idea?
Code:
Step event
if lockKeys = 0 {
//Do a million things based on player input
}
if key_up {
sprite_index = sPlayerH;
lockKeys = 1;
firingdelay = 0;
}
else {
lockKeys = 0;
}
This is fairly odd. I have different speeds on my sprites - could this be the cause of the problem, or does anyone have any other idea?