Commit 321c2fcf by BellCodeEditor

auto save

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