Commit 762a5739 by BellCodeEditor

auto save

parent ee439869
Showing with 12 additions and 3 deletions
...@@ -140,10 +140,18 @@ while True: ...@@ -140,10 +140,18 @@ while True:
if sprite.rect.x + sprite.rect.width < wukong.rect.x: if sprite.rect.x + sprite.rect.width < wukong.rect.x:
score += sprite.score score += sprite.score
sprite.score = 0 sprite.score = 0
print(score) if score > old_score:
score_audio.play()
old_score = score
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0)) scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20)) screen.blit(scoreSurf,(880,20))
scoreSurf = basic_font.render("第1名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf,(880,50))
scoreSurf = basic_font.render("第2名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf,(880,80))
scoreSurf = basic_font.render("第3名:"+str(one),True,(255,0,0))
screen.blit(scoreSurf,(880,110))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ 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