Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i in events:
- if i.type == pygame.KEYDOWN:
- if i.key == pygame.K_LEFT:
- lr = "LEFT"
- elif i.key == pygame.K_RIGHT:
- lr = "RIGHT"
- if i.type == pygame.KEYUP:
- if i.key == pygame.K_RIGHT and lr == 'RIGHT':
- lr = "STOP"
- elif i.key == pygame.K_LEFT and lr == 'LEFT':
- lr = "STOP"
- if lr == "LEFT":
- х -= 3
- elif lr == "RIGHT":
- х += 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement