im trying to make a game that requires you to have the spacebar and the right arrow key pressed to make the character move. However i just cant seem to link the 2 key presses together.
when the keys are pressed individually it works and when theyre pressed together it works but i want the character to be inactive until both are down at the same time :/
i've tried everything that i can think of (which is kinda limited) i thought id cracked it with a 'while' statement but when i tested it flash would throw a fit and close
heres the code that flash doesnt like, it looks (to me) like it should work but it clearly doesnt :P
PHP Code:
onClipEvent (load) {
_x = 0;
_y = 0;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.SPACE)) {
while (Key.isDown(Key.RIGHT)) {
_x += 1;
_y -= .4;
}
}
}
any help on this matter would be greatly appreciated, and if its not even possible then im glad i asked or id have been there all week
cheers