Commit 9172fe74 by BellCodeEditor

save project

parent 37fe6b17
Showing with 8 additions and 8 deletions
...@@ -55,12 +55,12 @@ score=0 ...@@ -55,12 +55,12 @@ score=0
speed=0 speed=0
old_score=0 old_score=0
block_list =pygame.sprite.Group() # 创建精灵组 block_list =pygame.sprite.Group() # 创建精灵组
with open('score.txt','r',encoding='utf-8')as f with open('record.txt','r',encoding='utf-8')as f:
content=f.read() content=f.read()
record=json.loads(content) record=json.loads(content)
one=record['第名'] one=record['第1名']
two=record['第名'] two=record['第2名']
thr=record['第名'] thr=record['第3名']
...@@ -77,7 +77,7 @@ while True: ...@@ -77,7 +77,7 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
speed=8+score//3
# 悟空造型 # 悟空造型
wukong = Player(hero[index]) wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
...@@ -140,11 +140,11 @@ while True: ...@@ -140,11 +140,11 @@ while True:
old_score=score old_score=score
scoreSurf = basic_font.render("score:"+str(score),True,(0,89,0)) scoreSurf = basic_font.render("score:"+str(score),True,(0,89,0))
screen.blit(scoreSurf,(850,20)) screen.blit(scoreSurf,(850,20))
scoreSurf=basic_font.render('第一名:'str(score),True,(255,255,255)) scoreSurf=basic_font.render('第一名:'+str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,50)) screen.blit(scoreSurf,(880,50))
scoreSurf=basic_font.render('第二名:'str(score),True,(255,255,255)) scoreSurf=basic_font.render('第二名:'+str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,80)) screen.blit(scoreSurf,(880,80))
scoreSurf=basic_font.render('第三名:'str(score),True,(255,255,255)) scoreSurf=basic_font.render('第三名:'+str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,110)) screen.blit(scoreSurf,(880,110))
......
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