Spam1985
Member
Hi all. Hoping you can clear up something for me. My player object has variables for storing control inputs:
Now I'd have thought just putting this in the create event would be fine, but no. I have to call this every step, otherwise the player does not respond to inputs and just shoots frequently!
I call these variables in the step event like this: if key_up do this or if key_shoot do this etc...
I mean, I've set these variables in the create event and they can't be changed. It's like he just forgets his variables?
Could anyone clear this up for me?
Code:
key_right = keyboard_check(ord("D"));
key_left = -keyboard_check(ord("A"));
key_up = -keyboard_check(ord("W"));
key_down = keyboard_check(ord("S"));
key_jump = keyboard_check_pressed(vk_space);
key_shoot = mouse_check_button(1);
key_use_item = mouse_check_button(3);
I call these variables in the step event like this: if key_up do this or if key_shoot do this etc...
I mean, I've set these variables in the create event and they can't be changed. It's like he just forgets his variables?
Could anyone clear this up for me?