def __init__(self, pos, screen, animations): self.animations = animations self.aspeed = 0.5 self.frame = 0 self.image = animations['s']['looking'][0] self.rect = self.image.get_rect() Mob.__init__(self, pos, screen)
def update(self): d = _headings[self.heading] if self.speed > 0.05: a = 'walking' else: a = 'looking' frames = self.animations[d][a] self.frame += self.aspeed self.frame %= len(frames) self.image = frames[int(self.frame)] Mob.update(self)