Rock Paper Scissors game - again (but soooo close).
How would one go about telling Flash “Hey, if the User does NOT hit the left down or right key within 1/8th of a second then…do something”?
Here’s my AS which works and displays a Rock, Paper or Scissors depending on the arrow key pressed, I just need some way to “time out” if they don’t press a key quick enough.
var keyListener_obj:Object = new Object();
keyListener_obj.onKeyDown = function() {
switch (Key.getCode()) {
case Key.LEFT :
RPSUser_mc.getNextHighestDepth();
RPSUser_mc.gotoAndStop(2);
break;
case Key.DOWN :
RPSUser_mc.getNextHighestDepth();
RPSUser_mc.gotoAndStop(3);
break;
case Key.RIGHT :
RPSUser_mc.getNextHighestDepth();
RPSUser_mc.gotoAndStop(4);
break;
}
};
Key.addListener(keyListener_obj);
I have no clue what I would need to search for to do this.