Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function compareButtonPress(buttonToPress, buttonPressed) {
- array possibleButtons(space, shift, enter, left, right, up, down, etc.);
- int pressedMatch = 0;
- for (x = 0; x < possibleButtons.length; x++) {
- if (possibleButtons(x) == buttonToPress && buttonPressed == buttonToPress) {
- pressedMatch++;
- } else if (buttonPressed == possibleButtons(x)) {
- pressedMatch = pressedMatch + 2;
- }
- }
- if (pressedMatch != 1) {
- return FALSE;
- } else {
- return TRUE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement