Commit 58f628c3 by BellCodeEditor

save project

parent b7890fc6
Showing with 16 additions and 16 deletions
......@@ -132,6 +132,20 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
if score>three:
if score>one:
score1['第1名']=score
score1['第2名']=one
score1['第3名']=tow
elif score>tow:
score1['第2名']=score
score1['第3名']=tow
else:
score1['第3名']=score
score1=json.dumps(score1,ensure_ascii=False)
with open('score.txt','w',encoding='utf-8')as f:
f.write(score1)
else:
if (sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score
......@@ -150,18 +164,5 @@ while True:
scoreSurf = basic_font.render("第3名:"+str(three), True, (255, 255, 255))
screen.blit(scoreSurf, (880,80))
# 刷新画面
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名": 59, "第2名": 1, "第3名": 0}
\ 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