Skip to content

Instantly share code, notes, and snippets.

@SteveClement
Created March 5, 2015 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveClement/c3c7f01f6bcf2b2f674f to your computer and use it in GitHub Desktop.
Save SteveClement/c3c7f01f6bcf2b2f674f to your computer and use it in GitHub Desktop.
Rudimentary keyboard input in pygame
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