def make_sprites(self):
        """
        Make any sprites for the level as needed.
        """
        sprites = pg.sprite.Group()

        for object in self.renderer.tmx_data.getObjects():
            properties = object.__dict__
            if properties['name'] == 'sprite':
                if 'direction' in properties:
                    direction = properties['direction']
                else:
                    direction = 'down'

                if properties['type'] == 'soldier' and direction == 'left':
                    index = 1
                else:
                    index = 0

                if 'item' in properties:
                    item = properties['item']
                else:
                    item = None

                if 'id' in properties:
                    id = properties['id']
                else:
                    id = None

                if 'battle' in properties:
                    battle = properties['battle']
                else:
                    battle = None

                if 'state' in properties:
                    sprite_state = properties['state']
                else:
                    sprite_state = None


                x = properties['x'] * 2
                y = ((properties['y']) * 2) - 32

                sprite_dict = {'oldman': person.Person('oldman',
                                                       x, y, direction),
                               'bluedressgirl': person.Person('femalevillager',
                                                              x, y, direction,
                                                              'resting', 1),
                               'femalewarrior': person.Person('femvillager2',
                                                              x, y, direction,
                                                              'autoresting'),
                               'devil': person.Person('devil', x, y,
                                                      'down', 'autoresting'),
                               'oldmanbrother': person.Person('oldmanbrother',
                                                              x, y, direction),
                               'soldier': person.Person('soldier',
                                                        x, y, direction,
                                                        'resting', index),
                               'king': person.Person('king', x, y, direction),
                               'evilwizard': person.Person('evilwizard', x, y, direction),
                               'treasurechest': person.Chest(x, y, id)}

                sprite = sprite_dict[properties['type']]
                if sprite_state:
                    sprite.state = sprite_state

                if sprite.name == 'oldman':
                    if self.game_data['old man gift'] and not self.game_data['elixir received']:
                        sprite.item = self.game_data['old man gift']
                    else:
                        sprite.item = item
                elif sprite.name == 'king':
                    if not self.game_data['talked to king']:
                        sprite.item = self.game_data['king item']
                else:
                    sprite.item = item
                sprite.battle = battle
                self.assign_dialogue(sprite, properties)
                self.check_for_opened_chest(sprite)
                if sprite.name == 'evilwizard' and self.game_data['crown quest']:
                    pass
                else:
                    sprites.add(sprite)

        return sprites
dataset/ETHPy150Open justinmeister/The-Stolen-Crown-RPG/data/states/levels.py/LevelState.make_sprites/original