I'm using AS2 and fps120.
I'm creating a tetris game, but I encountered a problem:
I made a function which makes the block go directly to the bottom on the press of "space".
But when I pressed space, the blocks stacked up immediately. It's because after I press space, another block apears immediately and goes to the bottom immediately, and keeps going until I release spade. It isn't a problem if I use lower fps, but my fps is 120, which means even I release space as quickly as I could, at least six blocks would stack up. I want to know is there anyway to detect the releasing of "space" or a detection which only detects on the instant I press, instead of when the key is down.
use a boolean:
There isn't Key.isUp, but I could have used !Key.isDown, which is the same, hopefully.
or use a listener for onKeyUp and onKeyDown