コード例 #1
0
        killing_monsters(game.zombies, 25, 30, 29)
        killing_monsters(game.skeletons, 25, 0, 1)
        hero.is_death()
        game.get_start_game()
        game.get_button_start_game()

        keys = pygame.key.get_pressed()
        if (keys[pygame.K_LEFT] and hero.x > 1) or (keys[pygame.K_a]
                                                    and hero.x > 1):
            hero.move(-2, 0)
            hero.draw_walking(GG_LEFT)

        elif (keys[pygame.K_RIGHT] and hero.x < 420) or (keys[pygame.K_d]
                                                         and hero.x < 420):
            hero.move(2, 1)
            hero.draw_walking(GG_RIGHT)

        elif keys[pygame.K_SPACE]:
            hero.shooting(game.shells)
            hero.draw_shooting()
        else:
            hero.draw_standing()

    if hero.death:
        game.stop_music()

    game.out_of_game()
    draw_game()

pygame.quit()