Commit fd30e07f by BellCodeEditor

auto save

parent 7c230b12
Showing with 2 additions and 1 deletions
...@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
music1=pygame.mixer.music.load('score.wav')
basic_font = pygame.font.Font('MSYH.TTF',18) basic_font = pygame.font.Font('MSYH.TTF',18)
index = 0 index = 0
y = 400 y = 400
...@@ -117,7 +118,7 @@ while True: ...@@ -117,7 +118,7 @@ while True:
screen.blit(gameover, (400, 200)) screen.blit(gameover, (400, 200))
gamestate = False gamestate = False
else: else:
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
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0)) scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
......
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