Commit 321c2fcf by BellCodeEditor

auto save

parent aab8af6a
Showing with 5 additions and 9 deletions
......@@ -44,19 +44,15 @@ while True:
if event.key==locals.K_DOWN and setheading!='up':
setheading='down'
snake_head=down
if snake_head=='right':
if setheading=='right':
x+=30
elif snake_head=='left':
elif setheading=='left':
x-=30
elif snake_head=='up':
elif setheading=='up':
y-=30
else:
y+=30
ponsition.append((x,y))
ponsition.pop(0)
# 将背景图画上去
......@@ -74,4 +70,4 @@ while True:
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
FPSCOLCK.tick(3)
\ No newline at end of file
FPSCOLCK.tick(8)
\ 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