Created
April 11, 2011 20:38
-
-
Save squarism/914276 to your computer and use it in GitHub Desktop.
ruby-processing keyCode for key_pressed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 38up 39right 40down 37left | |
def key_pressed | |
case key_code | |
when 32 | |
puts 'space' | |
when 37 | |
puts 'left' | |
when 38 | |
puts 'up' | |
when 39 | |
puts 'right' | |
when 40 | |
puts 'down' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment