Commit f83d133d by BellCodeEditor

save project

parent ac634519
Showing with 3 additions and 0 deletions
...@@ -54,6 +54,7 @@ time = 0 ...@@ -54,6 +54,7 @@ time = 0
gamestate = True gamestate = True
score=0 score=0
speed=8 speed=8
old_score=0
block_list =pygame.sprite.Group() # 创建精灵组 block_list =pygame.sprite.Group() # 创建精灵组
...@@ -125,6 +126,8 @@ while True: ...@@ -125,6 +126,8 @@ while True:
if (sprite.rect.x+sprite.rect.width)<wukong.rect.x: if (sprite.rect.x+sprite.rect.width)<wukong.rect.x:
score+=sprite.score score+=sprite.score
sprite.score=0 sprite.score=0
if score>old_score:
score_audio.play()
scoreSurf=basic_font.render('分数:'+str(score),True,(255,255,255)) scoreSurf=basic_font.render('分数:'+str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,20)) screen.blit(scoreSurf,(880,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