Created
March 5, 2015 17:15
-
-
Save SteveClement/c3c7f01f6bcf2b2f674f to your computer and use it in GitHub Desktop.
Rudimentary keyboard input in pygame
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
events = pygame.event.get() | |
for event in events: | |
if event.type == pygame.KEYDOWN: | |
if event.key == pygame.K_LEFT: | |
location -= 1 | |
if event.key == pygame.K_RIGHT: | |
location += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment