Commit 066396ee by BellCodeEditor

save project

parent c7761a1b
Showing with 6 additions and 0 deletions
......@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
basic_font = pygame.font.Font('STKAITI.TTF',32)
score_audio = pygame.mixer.Sound('score.wav')
index = 0
y = 400
jumpState = "runing"
......@@ -48,6 +49,7 @@ t = 30
road_x = 0
bg_x = 0
time = 0
score = 0
gamestate = True
speed= 8
block_list =pygame.sprite.Group() # 创建精灵组
......@@ -120,6 +122,10 @@ while True:
score += sprite.score
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))
screen.blit(scoreSurf,(850,20))
......
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