Commit ee47685b by BellCodeEditor

save project

parent b7fa3b79
Showing with 5 additions and 0 deletions
......@@ -27,6 +27,7 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
score = 0
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_RIGHT and setheading != "left":
......@@ -69,6 +70,9 @@ while True:
# 将果实画上去
screen.blit(food, (360, 300))
info = "Score:"+str(score)
text = my_font.render(info,True,(0,0,0))
screen.
# 刷新画面
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