J
josefflorian
Guest
Hi guys,
I am new to this group and very new to coding. I am trying to create a dash function on a platformer when the user hits 'X' on the keyboard. I have managed to do it succesfully when I do a keyboard check for vk_left, up, down and right individually.
Now I also want to do it in the 4 diagonal directions, so I need to tell game maker to dash diagonally if TWO keys are pressed along with 'X'. I have consulted the manual and tried to find the solution to no avail even though this seems rather basic.
Here's the part that isn't working:
if keyboard_check(vk_left) and keyboard_check (vk_up)
{
gravity = 0;
vspeed = -30;
friction = 5;
hspeed = -30;
dash = 1;
abletomove = 1;
alarm_set(0, 15);
}
Am I missing something here?
I am new to this group and very new to coding. I am trying to create a dash function on a platformer when the user hits 'X' on the keyboard. I have managed to do it succesfully when I do a keyboard check for vk_left, up, down and right individually.
Now I also want to do it in the 4 diagonal directions, so I need to tell game maker to dash diagonally if TWO keys are pressed along with 'X'. I have consulted the manual and tried to find the solution to no avail even though this seems rather basic.
Here's the part that isn't working:
if keyboard_check(vk_left) and keyboard_check (vk_up)
{
gravity = 0;
vspeed = -30;
friction = 5;
hspeed = -30;
dash = 1;
abletomove = 1;
alarm_set(0, 15);
}
Am I missing something here?