Commit 7ab6bbd8 by BellCodeEditor

auto save

parent bdc3e09e
Showing with 12 additions and 1 deletions
......@@ -25,8 +25,10 @@ apple_y=360
setheading = "right"
snake_head = right
fenshu = 0
jieshu = 0
changdu = 3
ziti = pygame.font.Font('simsun.ttc',30)#载入字体对象
ziti2 = pygame.font.Font('simsun.ttc',50)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -76,6 +78,14 @@ while True:
zifuchang = '分数:'+str(fenshu)+'\n长度:'+str(changdu)
text = ziti.render(zifuchang,True,(0,0,0))#创建字体变量
# 刷新画面
screen.blit(text,(400,10))#显示字
screen.blit(text,(400,10))
if 0>x or x>630 or 0>y or y>450:
text = ziti2.render('游戏结束',True,(255,0,0))
screen.blit(text,(230,240))
jieshu=1
pygame.display.update()
if jieshu==0:
#显示字
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