def __init__(self, map, name='Player'): CocosNode.__init__(self) self.map = map self.name = name self.human = Human(name) self.add(self.human)
def __init__(self, **kwargs): """Parts should be specified as string identifiers. They will be looked up in the part manager at initialization.""" CocosNode.__init__(self) # defaults self.width = 100 self.height = 100 # Set the car's parts. for part_type in parts.CLASSES.keys(): # We use the special add-methods because we don't want to set # the part dependant types again. for every part the first time. part = kwargs[part_type] if isinstance(part, str): part = parts.manager.get_part_by_id(part_type, part) getattr(self, '_add_' + part_type)(part) # Set the part dependant parts only once. self.set_part_dependant_properties() self.align_tyres() self.dirt = Dirt() self.add(self.dirt) self.init_sounds() self.reset() self.track = None
def __init__(self, *args, **kwargs): Shape.__init__(self, *args, **kwargs) CocosNode.__init__(self)