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)