Esempio n. 1
0
 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
Esempio n. 2
0
    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
Esempio n. 3
0
 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
Esempio n. 4
0
    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
Esempio n. 5
0
    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
Esempio n. 6
0
    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
Esempio n. 7
0
    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
Esempio n. 8
0
    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
Esempio n. 9
0
    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
Esempio n. 10
0
    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
Esempio n. 11
0
    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
Esempio n. 12
0
    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
Esempio n. 13
0
 def __init__(self, parent, name, next_state):
     State.__init__(self, parent, name)
     self.next_state = next_state
     self.blocks = ()
Esempio n. 14
0
 def __init__(self, cat):
     State.__init__(self, "eating")
     self.cat = cat
Esempio n. 15
0
 def __init__(self, cat):
     State.__init__(self, "roaming")
     self.cat = cat        
Esempio n. 16
0
 def __init__(self, cat):
     State.__init__(self, "runningToPot")
     self.cat = cat
Esempio n. 17
0
 def __init__(self, parent, name, success_state):
     State.__init__(self, parent, name)
     self.success_state = success_state
     self.fixed_up_top_key = None
Esempio n. 18
0
 def __init__(self, parent, name, next_state):
     State.__init__(self, parent, name)
     self.next_state = next_state
     self.blocks = ()