def __init__(self): AbstractGroup.__init__(self)
def __init__(self): AbstractGroup.__init__(self) self._spritelist = []
def add_internal(self, sprite): AbstractGroup.add_internal(self, sprite) self._spritelist.append(sprite)
def __init__(self, owner_map, *sprites): AbstractGroup.__init__(self) self.add(*sprites) self.owner_map = owner_map owner_map.group = self
# print(rect) # print(rect.centerx) # print(rect.bottom) # print(rect.midleft) class AbstractPrint(Sprite): def __init__(self): super().__init__() self.lines = 'abstract' def update(self): print(self.lines + " * ") abstract_prints = AbstractGroup() for numb in range(4): abstract_print = AbstractPrint() abstract_prints.add(abstract_print) print(abstract_print.lines + " " + str(numb) + " *") print(abstract_prints.update()) print(abstract_prints.spritedict) # def shot_bullet(): # pygame.init() # pygame.display.set_mode((100, 100)) # # abstract_bullets = AbstractGroup() # bullets = Group() # while True: # for event in pygame.event.get():
def __init__(self): AbstractGroup.__init__(self) self.zorder = []
def remove(self, sprite): AbstractGroup.remove(self, sprite) self.sort_by_z()
def add(self, sprite): AbstractGroup.add(self, sprite) self.sort_by_z()