pressed_tuple = pygame.key.get_pressed()标签:hero,tuple,230209,5if,元组,pressed,rect,pygame From: https://blog.51cto.com/u_13137233/6046616
if pressed_tuple[pygame.K_LEFT]:
hero_rect.x -= 5
if pressed_tuple[pygame.K_RIGHT]:
hero_rect.x += 5
if pressed_tuple[pygame.K_UP]:
hero_rect.y -= 5
if pressed_tuple[pygame.K_DOWN]:
hero_rect.y += 5