Commit 02d37128 by BellCodeEditor

save project

parent 27af75d7
Showing with 14 additions and 1 deletions
...@@ -56,6 +56,12 @@ block_list =pygame.sprite.Group() # 创建精灵组 ...@@ -56,6 +56,12 @@ block_list =pygame.sprite.Group() # 创建精灵组
score=0 score=0
speed=8 speed=8
old_score=0 old_score=0
with open("record.text","r",encoding="utf-8")as f:
content=f.read()
record=jdon.loads(content)
one=content["第一名"]
two=content["第二名"]
three=content["第三名"]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -129,7 +135,13 @@ while True: ...@@ -129,7 +135,13 @@ while True:
old_score=score old_score=score
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0)) scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20)) screen.blit(scoreSurf,(850,20))
scoreSurf = basic_font.render("第一名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf,(850,50))
scoreSurf = basic_font.render("第二名:"+str(two),True,(255,0,0))
screen.blit(scoreSurf,(850,80))
scoreSurf = basic_font.render("第三名:"+str(three),True,(255,0,0))
screen.blit(scoreSurf,(850,110))
#分数
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ 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