Commit 829be5c6 by BellCodeEditor

save project

parent 4613079b
Showing with 10 additions and 4 deletions
......@@ -39,7 +39,12 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
with open('score.txt','r',encoding='utf-8') as
with open('record.txt','r',encoding='utf-8') as f:
content = f.read()
record = json.loads(content)
one = record['第1名']
two = record['第2名']
three = record['第3名']
basic_font = pygame.font.Font('STKAITI.TTF',28)
score_audio = pygame.mixer.Sound('score.wav')
......@@ -128,11 +133,11 @@ while True:
scoreSurf = basic_font.render("分数:"+str(score),True,(255,255,255))
screen.blit(scoreSurf,(850,20))
scoreSurf = basic_font.render("第1名:"+str(one),True,(255,255,255))
screen.blit(scoreSurf,(850,40))
screen.blit(scoreSurf,(850,50))
scoreSurf = basic_font.render("第2名:"+str(two),True,(255,255,255))
screen.blit(scoreSurf,(850,60))
scoreSurf = basic_font.render("第3名:"+str(three),True,(255,255,255))
screen.blit(scoreSurf,(850,80))
scoreSurf = basic_font.render("第3名:"+str(three),True,(255,255,255))
screen.blit(scoreSurf,(850,110))
# 刷新画面
pygame.display.update()
FPS.tick(50)
\ 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