Commit bcc7a934 by BellCodeEditor

auto save

parent 5f422aeb
Showing with 6 additions and 6 deletions
......@@ -58,7 +58,8 @@ while True:
score+=10
a_x=random.randint(1,22)*30-30
a_y=random.randint(1,16)*30-30
else:
position.pop(0)
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去
......@@ -66,14 +67,13 @@ while True:
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
# 将果实画上去
screen.blit(food, (a_x,a_y))
# 刷新画面
inf='Score'+str(score)
tx=ft.render(inf,True,(255,255,0))
tx=ft.render(inf,True,(255,0,255))
screen.blit(tx,(0,0))
pygame.display.update()
FPSCLOCK.tick(3)
if x < 0 or x >660 or y < 0 or y >480:
exit()
\ 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