def __init__(self, groupList): """ COMMON VARIABLES """ enemy.Enemy.__init__(self) 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.active = True self.canCollide = True self.hitrect = pygame.Rect(0,0,54,98) self.position = vector.vector2d.zero self.velocity = vector.vector2d.zero """ UNIQUE VARIABLES """ self.speed = 4 self.target = self self.powerupGroup = groupList[POWERUP_GROUP] self.textGroup = groupList[TEXT_GROUP] self.effectsGroup = groupList[EFFECTS_GROUP] self.health = -1 self.changeDirection = 0 self.targetPoint = vector.vector2d.zero """ LEAVE SCREEN VARIABLES """ self.leaveScreen = False aitools.spawnOffScreen(self)
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)
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, 66, 82) """ UNIQUE VARIABLES """ self.speed = 9 self.target = target_object self.powerupGroup = groupList[POWERUP_GROUP] self.textGroup = groupList[TEXT_GROUP] self.effectsGroup = groupList[EFFECTS_GROUP] self.health = 2 self.dropItem = False self.bossFight = False """ LEAVE SCREEN VARIABLES """ self.lifeTimer = 5 * FRAMES_PER_SECOND self.leaveScreen = False done = aitools.spawnOffScreen(self)
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)
def __init__(self, groupList, myPosition): """ 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,68,74) self.position = vector.vector2d.zero self.velocity = vector.vector2d.zero """ UNIQUE VARIABLES """ self.speed = 12 self.changeDirection = 0 self.target = [0,0] self.powerupGroup = groupList[POWERUP_GROUP] self.textGroup = groupList[TEXT_GROUP] self.effectsGroup = groupList[EFFECTS_GROUP] self.health = 2 self.dropItem = False self.bossFight = False self.myPosition = myPosition """ LEAVE SCREEN VARIABLES """ self.lifeTimer = 5 * FRAMES_PER_SECOND self.leaveScreen = False if self.myPosition == 5: aitools.spawnOffScreen(self) Paajo.lastSpawn = self.position else: aitools.spawnAtPoint(self, Paajo.lastSpawn) if self.myPosition == 1: self.leader = self
def __init__(self, groupList, leader = None): """ 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,80,66) self.position = vector.vector2d.zero self.velocity = vector.vector2d.zero """ UNIQUE VARIABLES """ self.speed = 10 self.changeDirection = 0 self.target = [0,0] self.powerupGroup = groupList[POWERUP_GROUP] self.textGroup = groupList[TEXT_GROUP] self.effectsGroup = groupList[EFFECTS_GROUP] self.health = 1 self.bossFight = False self.dropItem = False """ EXIT GAME VARIABLES """ self.onScreen = 0 self.dead = False if leader == None: self.leader = self aitools.spawnOffScreen(self,128) Batto.lastSpawn = self.position else: self.leader = leader aitools.spawnAtPoint(self, Batto.lastSpawn)