diff --git a/my_game.py b/my_game.py index a06965d..bf23878 100644 --- a/my_game.py +++ b/my_game.py @@ -107,7 +107,7 @@ while True: obstacle = Block(bush,cacti,stone) block_list.add(obstacle) for sprite in block_list: # 遍历、展示障碍物精灵 - sprite.rect.x -= speed + sprite.rect.x -= 8 screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y)) if sprite.rect.x <= 0-sprite.rect.width: sprite.kill() @@ -115,8 +115,6 @@ while True: gameover = pygame.image.load('gameover.png') # 游戏结束 screen.blit(gameover, (400, 200)) gamestate = False - else: - if (sprite.rect.x+sprite.rect.width) scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0)) screen.blit(scoreSurf,(850,20))