Game Programming‎ > ‎

Special Keys

Special Keys, Backdoors and Easter Eggs

You can have special keys to give yourself extra lives, extra time, more lives, jump to the next level, play sounds, etc.

The message to add is the keydown message. Whenever a key is pressed on the keyboard, a keydown message is sent out with the letter. If a "p" is pressed then a message is sent out:
        keydown "p"

If you want to handle that message you add a "keydown" handler on your card script and add code for any keys that you want to intercept.

e.g.

            ------------------------ on the card ----------------------

on keydown x

  if x = "e" then
       add 100 to the fireld "score"
  end if
  if x = "p" then
       go to next card
  end if

end keydown

Comments