Commit f9e3a257 by BellCodeEditor

save project

parent 379a7225
Showing with 5 additions and 1 deletions
...@@ -52,6 +52,7 @@ road_x = 0 ...@@ -52,6 +52,7 @@ road_x = 0
a=True a=True
score=0 score=0
spen=8 spen=8
o_score=0
block_list=pygame.sprite.Group() block_list=pygame.sprite.Group()
# 创建障碍物 # 创建障碍物
#obstacle = Block(bush,cacti,stone) #obstacle = Block(bush,cacti,stone)
...@@ -65,6 +66,7 @@ while True: ...@@ -65,6 +66,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"
spen=8+score//3
# 悟空造型 # 悟空造型
wukong =Player(hero[index]) wukong =Player(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
...@@ -120,7 +122,9 @@ while True: ...@@ -120,7 +122,9 @@ while True:
score + = sprite.score score + = sprite.score
sprite.score=0 sprite.score=0
# print(score) # print(score)
if score>o_score:
score_audio.play()
o_score=score
scoreSurf=basic_foot.render("番薯:"+str(score),True,(255,255,255)) scoreSurf=basic_foot.render("番薯:"+str(score),True,(255,255,255))
score.blit(scoreSurf,(880,90)) score.blit(scoreSurf,(880,90))
pygame.display.update() pygame.display.update()
......
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