Commit 9b146939 by BellCodeEditor

save project

parent 113a740a
Showing with 12 additions and 7 deletions
...@@ -61,7 +61,13 @@ speed = 0 ...@@ -61,7 +61,13 @@ speed = 0
oldScore = 0 oldScore = 0
scoreMusic = pygame.mixer.Sound('score.wav') scoreMusic = pygame.mixer.Sound('score.wav')
#life = 1 #life = 1
#conDic = {} conDic = {}
with open('record.txt','r',encoding='utf-8') as f:
content = f.read()
conDic = json.load(content)
one = conDic["第1名"]
two = conDic["第2名"]
three = conDic["第3名"]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -131,12 +137,11 @@ while True: ...@@ -131,12 +137,11 @@ while True:
sprite.score = 0 sprite.score = 0
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,(850,20))
# tag = 20
#tag = 20 for k in conDic:
#for k in conDic: tag += 30
#tag += 30 show = basic_render(k+str(conDic[k]),True,(255,0,0))
#show = basic_render(k+str(conDic[k]),True,(255,0,0)) screen.blit(show,(850,tag))
#screen.blit(show,(850,tag))
if score > oldScore: if score > oldScore:
scoreMusic.play() scoreMusic.play()
......
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