📅  最后修改于: 2022-03-11 14:46:32.075000             🧑  作者: Mango
import 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