Commit f8ccae6a by BellCodeEditor

save project

parent 2205287b
Showing with 2 additions and 5 deletions
...@@ -23,16 +23,14 @@ while True: ...@@ -23,16 +23,14 @@ while True:
x+=30 x+=30
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
a.append((x,y))
a.pop(0)
screen.blit(right, (a[-1])) screen.blit(right, (a[-1]))
# 将贪吃蛇的身体画上去 # 将贪吃蛇的身体画上去
for i in range(len(a)-1): for i in range(len(a)-1):
screen.blit(body, (a[i])) screen.blit(body, (a[i]))
# 将果实画上去 # 将果实画上去
screen.blit(food, (360, 300)) screen.blit(food, (360, 300))
# 刷新画面 # 刷新画面
a.pop(0)
a.append((x,y))
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) 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