Commit 9c4a31cc by BellCodeEditor

save project

parent 23037b26
Showing with 10 additions and 5 deletions
...@@ -34,7 +34,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -34,7 +34,7 @@ hero = [pygame.image.load('hero1.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') score_audio = pygame.mixer.Sound('score.wav')
basic_font = pygame.font.Font('STKAITI.TTF',18) #basic_font = pygame.font.Font('STKAITI.TTF',18)
lu_x=0 lu_x=0
shan_x=0 shan_x=0
index = 0 index = 0
...@@ -43,9 +43,9 @@ jumpState = "runing" ...@@ -43,9 +43,9 @@ jumpState = "runing"
t = 30 t = 30
time = 0 time = 0
gamestate = True gamestate = True
score = 1 score = 0
#aa=Block(bush,cacti,stone) #aa=Block(bush,cacti,stone)
old_score = 0
block_list = pygame.sprite.Group() block_list = pygame.sprite.Group()
while True: while True:
...@@ -119,8 +119,12 @@ while True: ...@@ -119,8 +119,12 @@ while True:
score += sprite.score score += sprite.score
sprite.score = 0 sprite.score = 0
scoreSurf = basic_font.render("分数:" + str(score),True,(255,255,255))
screen.blit(scoreSurf,(880,20)) #scoreSurf = basic_font.render("分数:" + str(score),True,(255,255,255))
#screen.blit(scoreSurf,(880,20))
if score > old_score:
score_audio.play()
# 刷新画面 # 刷新画面
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