Commit 59909633 by BellCodeEditor

save project

parent a95fc94b
Showing with 8 additions and 9 deletions
......@@ -48,15 +48,14 @@ while True:
# 设置贪吃蛇的头部坐标
if setheading == "right":
x += 3
x += 30
elif setheading == "left":
x -= 3
x -= 30
elif setheading == "up":
y -= 3
y -= 30
else:
y += 3
if x < 0 or x > 630 or y < 0 or y > 450:
exit()
y += 30
position.append((x, y))
# 将背景图画上去
......@@ -80,5 +79,5 @@ while True:
text=myFont.render('score:'+str(score),True , (0,0,0))
screen.blit(text,(540,10))
# 刷新画面
pygame.display.u apdat()
FPSCLOCK.tick(50)
\ No newline at end of file
pygame.display.update()
FPSCLOCK.tick(3)
\ 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