Commit af5aef07 by BellCodeEditor

save project

parent 88ce7924
Showing with 5 additions and 2 deletions
......@@ -63,6 +63,7 @@ while True:
score+=10
else:
position.pop(0)
position.append((x, y))
# 将背景图画上去
screen.blit(background, (0, 0))
......@@ -71,12 +72,13 @@ while True:
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
screen.blit(body, position[i])
if x<0 or x>630 or y<0 or y>450:
exit()
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
# 刷新画面
info='score'+str(score)
text=my_font.render(info,True,(255,255,255))
text=my_font.render(info,True,(0,0,0))
screen.blit(text,(540,10))
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