Quickest way is to set a lock variable. So create a variable, in my case moving. There are 5 possible values for moving. 0 is no key pressed, 1 is right, 2 is up, 3 is left, 4 is down. On your keydown events, it should look like this.
actor -> Keydown (right) -> Script Editor
- Code: Select all
if(moving==0) // no key pressed
{
x+=5; // switch these to the appropriate x or y
moving=1; // set this to the appropriate value
}
actor -> Keyup (right) -> Script Editor
- Code: Select all
if(moving==1)
{
moving=0;
}
If you want you can #define or enum the values for left, up, right, and down, so that typing the word left, will be the same as typing 3.