def __init__(self, manager, target, sprite_filename): """manager is the base Cannon object target is the player's sprite """ State.__init__(self, manager) self.sprite = ASprite(sprite_filename, 0) self.target = target self.STATE_NUMBER = manager.STANDBY
def __init__(self, manager): State.__init__(self, manager) self.sprite = Sprite() self.sprite.image = Surface((0, 0)) self.sprite.rect = Rect(0, 0, 1, options.height) self.sprite.mask = Mask((1, options.height)) self.sprite.mask.fill() self.STATE_NUMBER = manager.DEACTIVATED
def __init__(self, manager, position, sprite_filename, speed): """manager is the base Cannon object position is the sprite's initial rect.center coordinate """ State.__init__(self, manager) self.sprite = ASprite(sprite_filename, speed) self.sprite.rect.center = position self.direction = vector.EAST self.STATE_NUMBER = manager.FIRING
def __init__(self, manager, position, direction, sprite_sheet, height, width, delay, speed): """manager is the base EnemyBase object position is the rect.center coordinates (taken from the spinning state) direction is a vector """ State.__init__(self, manager) self.sprite = AnimatedFacingSprite(sprite_sheet, height, width, delay, speed) self.sprite.rect.center = position self.direction = direction self.STATE_NUMBER = manager.SHOOTING self.IS_FOLLOWABLE = False
def __init__(self, manager, sprite_filename, speed, top, bottom, avg_transition): """manager is the root EnemyBase object top, bottom are the boundaries of movement (rect.top <= top, etc) """ State.__init__(self, manager) self.sprite = ASprite(sprite_filename, speed) self.sprite.rect.topright = (options.width, top) self.top = top self.bottom = bottom self.current_dir = vector.SOUTH self.transition_probability = 1.0 / (avg_transition * options.max_framerate) self.STATE_NUMBER = manager.MOVING self.IS_FOLLOWABLE = True
def __init__(self, manager, position, target, sprite_sheet, height, width, delay, targ_time, shoot_time): """manager is the root EnemyBase object position is the sprite's rect.center coordinates (taken from the moving state) sprite_sheet, etc are AnimatedFacingSprite args targ_time is the frame (from start) when target direction is taken shoot_time is the frame (from start) when spinner becomes shooter and begins movement """ State.__init__(self, manager) self.sprite = AnimatedFacingSprite(sprite_sheet, height, width, delay, 0) self.sprite.rect.center = position self.target = target self.targ_time = targ_time self.shoot_time = shoot_time self.tick = 0 self.STATE_NUMBER = manager.SPINNING self.IS_FOLLOWABLE = False
def __init__(self, parent, name, next_state): State.__init__(self, parent, name) self.next_state = next_state self.blocks = ()
def __init__(self, cat): State.__init__(self, "eating") self.cat = cat
def __init__(self, cat): State.__init__(self, "roaming") self.cat = cat
def __init__(self, cat): State.__init__(self, "runningToPot") self.cat = cat
def __init__(self, parent, name, success_state): State.__init__(self, parent, name) self.success_state = success_state self.fixed_up_top_key = None