Commit 42e69711 by BellCodeEditor

save project

parent 99779f14
Showing with 15 additions and 5 deletions
......@@ -132,10 +132,20 @@ while True:
screen.blit(gameover, (400, 200))
if die :
gamestate = False
if score > one:
record["第3名"]=record["第2名"]
record["第2名"]=record["第1名"]
record["第1名"]=score
elif score>two:
record["第3名"]=record["第2名"]
record["第2名"]=score
else:
record["第3名"]=score
with open('record.txt','w',encoding='utf-8') as f:
f.write(json.dumps(record,ensure_ascii=False))
else:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
score += sprite.score
sprite.score = 0
if score>old_score:
scoresy.play()
......@@ -146,9 +156,9 @@ while True:
screen.blit(dieXX,(10,20))
scoreSurf = basic_font.render("第一名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf,(850,40))
scoreSurf = basic_font.render("第二名:"+str(one),True,(255,0,0))
scoreSurf = basic_font.render("第二名:"+str(two),True,(255,0,0))
screen.blit(scoreSurf,(850,60))
scoreSurf = basic_font.render("第三名:"+str(one),True,(255,0,0))
scoreSurf = basic_font.render("第三名:"+str(three),True,(255,0,0))
screen.blit(scoreSurf,(850,80))
# 刷新画面
......
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
{"第1名": 12, "第2名": 8, "第3名": 7}
\ 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