Commit ea22d4d8 by BellCodeEditor

save project

parent c3ddfb44
Showing with 6 additions and 6 deletions
......@@ -27,16 +27,16 @@ while True:
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_RIGHT and setheading != 'left':
setheading == 'right'
setheading = "right"
set_head = right
if event.key == locals.K_LEFT and setheading != 'right':
setheading == 'left'
setheading = "left"
set_head = left
if event.key == locals.K_UP and setheading != 'down':
setheading == 'up'
setheading = "up"
set_head = up
if event.key == locals.K_DOWN and setheading != 'up':
setheading == 'down'
setheading = "down"
set_head = down
if setheading == "right":
x += 30
......@@ -60,4 +60,4 @@ while True:
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
FPS.tick(3)
\ No newline at end of file
FPS.tick(1)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment