diff --git a/my_game.py b/my_game.py index cf22a22..d4b241f 100644 --- a/my_game.py +++ b/my_game.py @@ -40,8 +40,8 @@ hero = [pygame.image.load('hero1.png'), pygame.image.load('hero3.png'), pygame.image.load('hero4.png'), pygame.image.load('hero5.png')] -my.font=pygame.font.Font("") -score_ +#my.font=pygame.font.Font("STKAITI.TTF") + index = 0 y = 400 jumpState = "runing" @@ -69,7 +69,6 @@ while True: if jumpState == "runing": if event.key == locals.K_SPACE: jumpState = "up" - speed=8// # 悟空造型 wukong = Player(hero[index]) if jumpState == "runing": # 跑步状态下 @@ -137,10 +136,7 @@ while True: with open("record.txt","w",encoding="utf-8") as file: file.write(record) - else: - if sprite.rect.x+sprite.rect.width<wukong.rect.x: - score+=sprite.score - sprite.score=0 + if score>old.score: score_sound.play()