def __init__(self, world, family = None, position = None): if position == None: offsets = (int(dimension/5.0) for dimension in RESOLUTION) position = tuple(randint(offset, dimension - offset) for offset, dimension in zip(offsets, RESOLUTION)) Paintable.__init__(self, position) self.boundingBox = Rect(position, self.attributes.dimensions) self.age = 0 self.health = self.attributes.health self.growthFactor = self.attributes.growthFactor self.carriedEntity = None self.beingCarried = False if family: self.family = family else: self.family = Family(world) self.family.boundingBox = self.boundingBox # self.family.addMember(self) # self.behavior = ComplexBehavior(self, world) world.register(self)
def __init__(self): Paintable.__init__(self) self.entities = [] self.families = {}