A
Aaron McDonald
Guest
Hi,
so I'm attempting to program the animations for 8 direction movement using "WASD." I can't figure out the syntax though for talking about pressing only one key, or pressing both keys. Here's the pseudocode for what I'm trying:
IF ('S' key is pressed BUT NOT 'A' key or 'D' key)
THEN {play "forward" animation...}
IF ('S' key and 'A' key are both pressed)
THEN {play "forwardLeft" animation}
etc...
The main thing that's confusing to me is how to use the "keyboard_check_pressed(ord('S'))" syntax in combination with the '!' assignment and other keys presses. Hope my question makes sense, thank you!
so I'm attempting to program the animations for 8 direction movement using "WASD." I can't figure out the syntax though for talking about pressing only one key, or pressing both keys. Here's the pseudocode for what I'm trying:
IF ('S' key is pressed BUT NOT 'A' key or 'D' key)
THEN {play "forward" animation...}
IF ('S' key and 'A' key are both pressed)
THEN {play "forwardLeft" animation}
etc...
The main thing that's confusing to me is how to use the "keyboard_check_pressed(ord('S'))" syntax in combination with the '!' assignment and other keys presses. Hope my question makes sense, thank you!