def make_level_portals(self):
        """
        Make the portals to switch state.
        """
        portal_group = pg.sprite.Group()

        for object in self.renderer.tmx_data.getObjects():
            properties = object.__dict__
            if properties['name'] == 'portal':
                posx = properties['x'] * 2
                posy = (properties['y'] * 2) - 32
                new_state = properties['type']
                portal_group.add(portal.Portal(posx, posy, new_state))


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