Commit 206ac533 by BellCodeEditor

save project

parent fee17078
Showing with 10 additions and 9 deletions
......@@ -127,8 +127,8 @@ while True:
screen.blit(gameover, (400, 200))
gamestate = False
#更新
if score>thr:
if score>one:
if score > thr:
if score > one:
record["第1名"]=score
record["第2名"]=one
record["第3名"]=two
......@@ -137,7 +137,7 @@ while True:
record["第3名"]=two
else:
record["第3名"]=score
record = json.dumps(record,ensure_ascil=False)
record = json.dumps(record,ensure_ascii=False)
with open("record.txt","w",encoding="utf-8") as f:
f.write(record)
else:
......@@ -151,13 +151,13 @@ while True:
#分数
scoreFont=baisc_font.render("分数"+str(score),True,(255,255,255))
screen.blit(scoreFont,(880,20))
#_________________________________________________________________
scoreSurf=baisc_font.render("第1名"+str(one),True,(255,255,255))
screen.blit(scoreFont,(880,50))
screen.blit(scoreSurf,(880,50))
scoreSurf=baisc_font.render("第2名"+str(two),True,(255,255,255))
screen.blit(scoreFont,(880,80))
screen.blit(scoreSurf,(880,80))
scoreSurf=baisc_font.render("第3名"+str(thr),True,(255,255,255))
screen.blit(scoreFont,(880,110))
screen.blit(scoreSurf,(880,110))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
{"第1名": 4, "第2名": 3, "第3名": 2}
\ 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