Commit 93aeb080 by BellCodeEditor

auto save

parent 4e57ea35
Showing with 14 additions and 2 deletions
......@@ -125,6 +125,20 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
if score>one:
sf["第1名"]=score
sf["第2名"]=one
sf["第3名"]=second
elif score>second:
sf["第2名"]=score
sf["第3名"]=second
elif score>third:
sf["第3名"]=score
recond=json.dumps(sf,ensure_ascii=False)
with open('record.txt','w',encoding='utf-8')as f:
f.write(record)
else:
if (sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score
......
{"第1名": 10000, "第2名": 709347593465, "第3名": 1000}
\ 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