S
sjschindler
Guest
Hello again. I never did thank the two lovely people who helped with the last issue I had, so thank you to them.
Right now, I have a game that has portals that connect between two rooms. I also have a fade transition that requires the player to always collide with the object. That is not the issue here, and I have already found a workaround for that. My issue is that when I am transported to the next room, I want to have my movement stopped for a few seconds to allow the fade to finish before a player can move again. I do understand you can just not press the right arrow key and everything will be fine, but sadly during playtesting, I found that everyone(literally everyone) kept holding down the right arrow key. So in order to combat this habit, I wanted to make it so the player would stop moving, even if the player was holding the right arrow key for a few seconds.
Can anyone understand what I'm saying and help me if so? I've been combating this problem on my own for a few days and I would appreciate any help. Thank you!
Movement Code:
///Movement for Nyx
//Get Player Input
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
//React to inputs
move = key_left + key_right;
hsp = move * movespeed;
if (vsp < 10) vsp += grav;
if (move = 0)
{
image_index = 1
}
if(keyboard_check_pressed(vk_right)) facing = 1;
if(keyboard_check_pressed(vk_left)) facing = -1;
if keyboard_check(vk_shift)
{
hsp = move * (movespeed * 3);
}
Right now, I have a game that has portals that connect between two rooms. I also have a fade transition that requires the player to always collide with the object. That is not the issue here, and I have already found a workaround for that. My issue is that when I am transported to the next room, I want to have my movement stopped for a few seconds to allow the fade to finish before a player can move again. I do understand you can just not press the right arrow key and everything will be fine, but sadly during playtesting, I found that everyone(literally everyone) kept holding down the right arrow key. So in order to combat this habit, I wanted to make it so the player would stop moving, even if the player was holding the right arrow key for a few seconds.
Can anyone understand what I'm saying and help me if so? I've been combating this problem on my own for a few days and I would appreciate any help. Thank you!
Movement Code:
///Movement for Nyx
//Get Player Input
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
//React to inputs
move = key_left + key_right;
hsp = move * movespeed;
if (vsp < 10) vsp += grav;
if (move = 0)
{
image_index = 1
}
if(keyboard_check_pressed(vk_right)) facing = 1;
if(keyboard_check_pressed(vk_left)) facing = -1;
if keyboard_check(vk_shift)
{
hsp = move * (movespeed * 3);
}