def __init__(self, pos=(0, 0), orient=(1, 0)): super(Item, self).__init__(pos) self.orient = orient self.restTime = None if self.modelName: self.model = objReader.load(self.modelName) else: self.model = None self._pt = 0 self._nextPos = pos
def __init__(self, aniFolder, sprite): self.sprite = sprite filenames = os.listdir(os.path.join(config.MODEL_DIR, aniFolder)) xs = [(extract_num(x),x) for x in filenames if extract_num(x) is not None] xs.sort() self.frameModels = [] cnt = 0 for i, x in xs: model = objReader.load(os.path.join(aniFolder, x)) self.frameModels.append(model) cnt += 1 if cnt == config.ANIMATION_CUT: break self.nFrames = len(self.frameModels) self.loop = True self.start()
def __init__(self, aniFolder, sprite): self.sprite = sprite filenames = os.listdir(os.path.join(config.MODEL_DIR, aniFolder)) xs = [(extract_num(x), x) for x in filenames if extract_num(x) is not None] xs.sort() self.frameModels = [] cnt = 0 for i, x in xs: model = objReader.load(os.path.join(aniFolder, x)) self.frameModels.append(model) cnt += 1 if cnt == config.ANIMATION_CUT: break self.nFrames = len(self.frameModels) self.loop = True self.start()