Commit f858e9ce by BellCodeEditor

save project

parent 078cd3b0
Showing with 5 additions and 1 deletions
File added
...@@ -33,6 +33,8 @@ hero = [pygame.image.load('hero1.png'), ...@@ -33,6 +33,8 @@ 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')]
score_audio=pygame.mixer.Sound('score.wav')
basic_font=pygame.font.Font('STKAITI.TTF',18)
road_x=0 road_x=0
shan_x=0 shan_x=0
index = 0 index = 0
...@@ -109,7 +111,8 @@ while True: ...@@ -109,7 +111,8 @@ while True:
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
print(score)
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ No newline at end of file
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