def die(self): if self.dying == 0: deathType = int(random.random() * 3) #print deathType if deathType == 0: tempImage = text.TextSurface(FONT_PATH, 30, FONT_COLOR, "Blast!").image utility.playSound(self.deathSound[0], OW_CHANNEL) elif deathType == 1: tempImage = text.TextSurface(FONT_PATH, 30, FONT_COLOR, "Oh No!").image utility.playSound(self.deathSound[1], OW_CHANNEL) elif deathType == 2: tempImage = text.TextSurface(FONT_PATH, 30,FONT_COLOR, "Bother!").image utility.playSound(self.deathSound[2], OW_CHANNEL) self.animationList.play("Die") self.bounds = [-1000, -1000, SCREEN_WIDTH + 1000, SCREEN_HEIGHT + 32] self.boundStyle = BOUND_STYLE_CUSTOM helpBubble = infoBubble.infoBubble(tempImage, self, 5 * FRAMES_PER_SECOND) helpBubble.offSet = vector.vector2d(0.0, -100.0) self.bulletGroup.add(helpBubble) self.dying += 1 if settingList[PARTICLES] and not self.dying % 2: puffsToCreate = 4 while puffsToCreate: puffsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff)
def actorUpdate(self): utility.playMusic(self.music, True) self.placeEye() if self.lifeTimer <= 30 * FRAMES_PER_SECOND and self.health == self.world.level+ 2: if self.lifeTimer == 30 * FRAMES_PER_SECOND: tempImage = self.howToKill helpBubble = infoBubble.infoBubble(tempImage, self.target,5 * FRAMES_PER_SECOND) helpBubble.offSet = vector.vector2d(0.0, -100.0) self.textGroup.add(helpBubble) self.lifeTimer += 1 if not self.active and self.health > 0: self.active = True if self.active: if self.stunned: if self.charging: self.speed -= 0.2 if self.speed <= 1.75: self.speed = 1.75 self.charging = False self.timeUntilCharge = 6 * FRAMES_PER_SECOND self.velocity.makeNormal() self.velocity *= self.speed self.currentSequence = 1 self.stunned -= 1 if not self.stunned: self.textGroup.add(self.eye) self.animationList.play("idle") if not self.stunned % 4: puffsToCreate = 4 while puffsToCreate and settingList[PARTICLES]: puffsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff) else: self.currentSequence = 0 self.processAI() if self.health <= 0: self.active = False self.die() if not self.gaveBonus: self.world.giveBonus() self.gaveBonus = True
def die(self): if self.objectCollidedWith.actorType == ACTOR_TYPE_BAAKE: if settingList[PARTICLES]: starsToCreate = 1 while starsToCreate: starsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff) self.kill()
def die(self): self.stunned -= 1 self.velocity[1] += .1 self.world.pauseSpawning = 1 * FRAMES_PER_SECOND if settingList[PARTICLES] and not self.stunned % 2: puffsToCreate = 4 while puffsToCreate and settingList[PARTICLES]: puffsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff)
def actorUpdate(self): if not self.stunned: try: self.emitter.update() except: pass utility.playMusic(self.music, True) if not self.active and self.health > 0: self.active = True if self.lifeTimer <= 30 * FRAMES_PER_SECOND and self.health == self.world.level + 2: if self.lifeTimer == 30 * FRAMES_PER_SECOND: tempImage = self.howToKill helpBubble = infoBubble.infoBubble(tempImage, self.target,5 * FRAMES_PER_SECOND) helpBubble.offSet = vector.vector2d(0.0, -100.0) self.textGroup.add(helpBubble) self.lifeTimer += 1 if self.active: if self.stunned: self.stunned -= 1 if not self.stunned % 4: puffsToCreate = 4 while puffsToCreate and settingList[PARTICLES]: puffsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff) if not self.stunned: self.animationList.play("idle") else: self.currentSequence = 0 self.processAI() if self.health <= 0: self.active = False self.die() if not self.gaveBonus and self.world.worldName != "Tutorial": self.world.giveBonus() self.gaveBonus = True
def die(self): self.emitter = None if self.world.worldName == "Tutorial": self.world.bossDead = True self.velocity[1] += .1 self.boundStyle = BOUND_STYLE_CUSTOM self.stunned -= 1 self.world.pauseSpawning = 1 * FRAMES_PER_SECOND if settingList[PARTICLES] and not self.stunned % 2: puffsToCreate = 4 while puffsToCreate and settingList[PARTICLES]: puffsToCreate -= 1 tempPuff = particle.smokeParticle(self.position, [1,0]) tempPuff.velocity.setAngle(359 * random.random()) self.effectsGroup.add(tempPuff)