T
tech9151
Guest
Hi,
I just started using game maker again and am trying to make a basic project to visualize an idea of mine. I seem to be having trouble with a code already as I thought we could use the keyboard_check in the step event? Seems to not work at all. I tested to see if I used the Keyboard Event itself if it would work and it did. If someone can let me know if it is possible to use keyboard_check in step event or if I should just use the keyboard event.
Thanks, code below, variable is key_enter that I am trying to get to work.
Create Event:
Step Event:
I just started using game maker again and am trying to make a basic project to visualize an idea of mine. I seem to be having trouble with a code already as I thought we could use the keyboard_check in the step event? Seems to not work at all. I tested to see if I used the Keyboard Event itself if it would work and it did. If someone can let me know if it is possible to use keyboard_check in step event or if I should just use the keyboard event.
Thanks, code below, variable is key_enter that I am trying to get to work.
Create Event:
Code:
MP = 0;
GP = 0;
turn = false;
sel_on = false;
num = 0;
num_max = 2;
sel[0] = "Base";
sel[1] = "Attack Unit";
sel[2] = "Defense Unit";
key_enter = keyboard_check_released(vk_enter);
key_l = keyboard_check(vk_left);
key_r = keyboard_check(vk_right);
Step Event:
Code:
if key_enter
sel_on = true;
if sel_on
{
if key_l
{
num -= 1;
if num < 0 num = num_max;
}
if key_r
{
num +=1 ;
if num > num_max num = 0;
}
}