我正在尝试使角色翻转,以使其具有向左走而不是向后走的幻觉。
这是我的课程,需要一些帮助。
for event in pygame.event.get():
if moving_up:
y_coord += -speed[1] # Negative speed, because positive y is down!
if moving_down:
y_coord += speed[1]
if moving_right:
x_coord += speed[0]
if moving_left:
x_coord += -speed[0]
if event.type == KEYDOWN:
if event.key == K_w:
moving_up = True
if event.key == K_d:
moving_right = True
if event.key == K_s:
moving_down = True
if event.key == K_a:
moving_left = True
if event.type == KEYUP:
if event.key == K_w:
moving_up = False
if event.key == K_d:
moving_up = False
if event.key == K_s:
moving_up = False
if event.key == K_a:
moving_up = False
if event.key == K_a:
我需要知道将图像更改为翻转所需的代码,以使其看起来向左移动。谢谢。