def __init__(self, xy, wh, bgColor=None, add=True): Sprite.__init__(self, xy, wh) if bgColor: self.image.fill(bgColor) if add: globs.currentgame.entities.add(self)
def __init__(self, xy, flags=[], wh=(50,50), bgColor=None, alpha=None): Sprite.__init__(self, xy, wh) self.bgColor = bgColor if not 'uncollidable' in flags: globs.currentgame.collidableBlocks.add(self) self.collidable = True else: self.collidable = False if 'climbable' in flags: globs.currentgame.climbableBlocks.add(self) if 'actionBlock' in flags: globs.currentgame.actionBlocks.add(self) if 'worldActionBlock' in flags: globs.currentgame.worldActionBlocks.add(self) if bgColor: self.image.fill(self.bgColor) if alpha: self.image.set_alpha(alpha)