Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pygame keyboard input

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pygame #keyboard #input
ADD COMMENT
Topic
Name
6+6 =