Created
March 14, 2009 22:32
-
-
Save shawn42/79209 to your computer and use it in GitHub Desktop.
This file contains 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
i = @input_manager | |
i.reg KeyDownEvent, K_SPACE do | |
ship.warp vec2(rand(400)-100,rand(400)-100) | |
end | |
i.reg KeyDownEvent, K_LEFT do | |
ship.moving_left = true | |
end | |
i.reg KeyDownEvent, K_RIGHT do | |
ship.moving_right = true | |
end | |
i.reg KeyDownEvent, K_UP do | |
ship.moving_forward = true | |
end | |
i.reg KeyDownEvent, K_DOWN do | |
ship.moving_back = true | |
end | |
i.reg KeyUpEvent, K_LEFT do | |
ship.moving_left = false | |
end | |
i.reg KeyUpEvent, K_RIGHT do | |
ship.moving_right = false | |
end | |
i.reg KeyUpEvent, K_UP do | |
ship.moving_forward = false | |
end | |
i.reg KeyUpEvent, K_DOWN do | |
ship.moving_back = false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment