Commit 3b8e2e4d by BellCodeEditor

save project

parent 33bea3a8
Showing with 4 additions and 0 deletions
......@@ -71,12 +71,16 @@ while True:
info="Score: " + str(score)
text=font.render(info,True,(0,0,0))
screen.blit(text,(530,0))
if x<0 or x>630 or y<0 or y>450:
exit()
# 将贪吃蛇的头画上去
screen.blit(snake_head, position[-1])
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
if (x,y)==position[i]:
exit()
# 刷新画面
screen.blit(food, (apple_x,apple_y))
pygame.display.update()
......
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