Commit 1e82a694 by BellCodeEditor

save project

parent a924c16f
Showing with 15 additions and 2 deletions
...@@ -125,6 +125,19 @@ while True: ...@@ -125,6 +125,19 @@ while True:
gameover=pygame.image.load('gameover.png') gameover=pygame.image.load('gameover.png')
screen.blit(gameover, (400,200)) screen.blit(gameover, (400,200))
zhuangtai=2 zhuangtai=2
if score>thr:
record["第1名"]=score
record["第2名"]=one
record["第3名"]=two
elif score>two:
record["第2名"]=score
record["第3名"]=two
else:
if score>one:
record["第3名"]=score
jsonzfc = json.dumps(record,ensure_ascii=False)
with open("record.txt","w",encoding="UTF=8") as f:
f.write(jsonzfc)
else: else:
if prpo.rect.x + prpo.rect.width < wukong.rect.x: if prpo.rect.x + prpo.rect.width < wukong.rect.x:
score +=prpo.score score +=prpo.score
......
{"第1名": 100, "第2名": 50, "第3名": 30} {"第1名": 1, "第2名": 2, "第3名": 0}
\ No newline at end of file \ 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