def __init__(self): super(BackgroundLayer, self).__init__() resource = Resource() self.image = resource.load_image(random.choice(self.BACKGROUNDS)) self.image.width = self.__scale_width() self.image.height = self.__scale_height() resource.center_image_anchor_point(self.image)
def __init__(self, pos_x, pos_y): resource = Resource() image = resource.load_image('wall.png') super(WallSprite, self).__init__(image) self.image.width = BOARD_UNITY_WIDTH self.image.height = BOARD_UNITY_HEIGHT resource.center_image_anchor_point(self.image) self.position = (pos_x, pos_y)