def __parse_background(self) -> Surface:
     element: ET.Element = self.root.find('background')
     if 'color' in element.attrib:
         surface: Surface = Surface(self.__parse_dimensions(element))
         surface.fill(self.__parse_color(element))
         return surface
     else:
         return ResourceManagement.get_image(element.attrib['src'])
    def __parse_box(self, element: ET.Element) -> GameObject:
        if 'src' in element.attrib:
            surface: Surface = ResourceManagement.get_image(
                element.attrib['src'])
        else:
            surface: Surface = Surface(self.__parse_dimensions(element))
            if 'invisible' in element.attrib:
                surface = surface.convert_alpha()
                surface.fill((0, 0, 0, 0))
            else:
                surface.fill(self.__parse_color(element))

        go = GameObject(surface)
        self.__assign_transform(element, go)

        return go
Esempio n. 3
0
 def __init__(self):
     sprite: Surface = ResourceManagement.get_image('orb_slam.png')
     RigidPhysicsAwareGameObject.__init__(self, sprite, 0)