Exemple #1
0
    def __init__(self, world, target, groupList):

        """   COMMON VARIABLES   """
        actor.Actor.__init__(self)
        self.actorType = ACTOR_TYPE_BOSS      
        
        self.animationList = copy.copy(self.MasterAnimationList)
        self.animationList.setParent(self)
        self.animationList.play("idle")
        
        self.rect = self.image.get_rect()
        
        self.boundStyle = BOUND_STYLE_REFLECT
        self.bounds = [0,0,SCREEN_WIDTH,SCREEN_HEIGHT]
                
        self.canCollide = True
        self.hitrect = pygame.Rect(0,0,106,130)
        
        self.position = vector.vector2d(-32, SCREEN_HEIGHT / 2)
        self.velocity = vector.vector2d.zero
        
        """   UNIQUE VARIABLES   """
        self.target = target
        self.world = world
        self.lifeTimer = 0

        self.speed = 5
        self.health = self.world.level + 2
        
        self.sequenceList = [[0]]

        self.stunned = 0

        self.powerupGroup = groupList[POWERUP_GROUP]
        self.textGroup = groupList[TEXT_GROUP]
        self.effectsGroup = groupList[EFFECTS_GROUP]
        self.enemyGroup = groupList[ENEMY_GROUP]

        self.gaveBonus = False

        """    AI VARIABLES    """
        self.spinning = False
        self.timeUntilSpin = 0
        self.targetPoint = None

        self.changeDirection = 0

        self.emitter = particle.particleEmitter(vector.vector2d.zero, vector.vector2d(60.0,5.0),
                                self.effectsGroup,
                                ["rain"],
                                270.0,45.0,
                                0.0,0.0,
                                3.0,2.0,
                                -1.0)
        
        self.emitter.mountTo(self, vector.vector2d(0.0,50.0))
Exemple #2
0
    def __init__(self, targetObject, groupList):
        """   COMMON VARIABLES   """
        enemy.Enemy.__init__(self)

        """    Rokubi Spawning    """
        self.noSpawn = False
        
        self.actorType = ACTOR_TYPE_ENEMY
        
        self.animationList = copy.copy(self.MasterAnimationList)
        self.animationList.setParent(self)
        self.animationList.play("Idle")      
        
        self.rect = self.image.get_rect()
        
        self.boundStyle = BOUND_STYLE_NONE
        self.bounds = [-32,-32,(SCREEN_WIDTH + 32),(SCREEN_HEIGHT + 32)]        
        
        self.canCollide = True        
        self.hitrect = pygame.Rect(0,0,54,98)

        self.velocity = vector.vector2d(0,0)

        """   UNIQUE VARIABLES   """
        self.speed = 7
        self.hideBehind = targetObject
        self.target = targetObject
        self.powerupGroup = groupList[POWERUP_GROUP]
        self.enemyGroup = groupList[ENEMY_GROUP]
        self.textGroup = groupList[TEXT_GROUP]
        self.effectsGroup = groupList[EFFECTS_GROUP]
        self.bossGroup = groupList[BOSS_GROUP]
        self.health = 1
        self.dropItem = False
        self.bossFight = False
        self.charging = False
        self.hiding = False

        self.emitter = particle.particleEmitter(vector.vector2d.zero,vector.vector2d.zero,
                                        self.effectsGroup,
                                        ["heart"],
                                        270.0,45.0,
                                        0.0,0.0,
                                        8.0,1.0,
                                        -1.0)
        

        
        self.emitter.mountTo(self)

        aitools.spawnOffScreen(self)
Exemple #3
0
    def __init__(self, target_object, groupList):
       """   COMMON VARIABLES   """
       enemy.Enemy.__init__(self)
        
       self.actorType = ACTOR_TYPE_ENEMY    
       
       self.animationList = copy.copy(self.MasterAnimationList)
       self.animationList.setParent(self)
       self.animationList.play("Idle")  
        
       self.rect = self.image.get_rect()
    
       self.boundStyle = BOUND_STYLE_CUSTOM
       self.bounds = [32,32,(SCREEN_WIDTH - 32),(SCREEN_HEIGHT - 32)]        
    
       self.canCollide = True 
       self.hitrect = pygame.Rect(0,0,54,58)
       self.hitrectOffsetY = 6

       self.velocity = vector.vector2d.zero

       """   UNIQUE VARIABLES   """
       self.speed = 2
       self.target = target_object
       self.powerupGroup = groupList[POWERUP_GROUP]
       self.textGroup = groupList[TEXT_GROUP]
       self.effectsGroup = groupList[EFFECTS_GROUP]
       self.health = 3
       self.bossFight = False
       self.dropItem = False
       
       self.deathEmitter = particle.particleEmitter(vector.vector2d.zero,
                        self.effectsGroup,
                        ["puff"],
                        0.0,360.0,
                        5.0,0.0,
                        1.0,4.0,
                        -1.0)
       
       self.deathEmitter.mountTo(self)

       """    LEAVE SCREEN VARIABLES    """
       self.lifeTimer = 10 * FRAMES_PER_SECOND
       self.leaveScreen = False

       aitools.spawnOffScreen(self)