Beispiel #1
0
    def actor_update(self):
        utility.play_music(self.music, True)
        self.place_eye()

        if self.life_timer <= 30 * FRAMES_PER_SECOND and self.health == self.world.level+ 2:
            if self.life_timer == 30 * FRAMES_PER_SECOND:
                temp_image = self.how_to_kill
                help_bubble = infobubble.InfoBubble(temp_image, self.target, 5 * FRAMES_PER_SECOND)
                help_bubble.offset = vector.Vector2d(0.0, -100.0)
                self.text_group.add(help_bubble)

            self.life_timer += 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.time_until_charge = 6 * FRAMES_PER_SECOND
                
                    self.velocity.make_normal()
                    self.velocity *= self.speed
                
                self.current_sequence = 1
                self.stunned -= 1

                if not self.stunned:
                    self.text_group.add(self.eye)
                    self.animation_list.play('idle')

                if not self.stunned % 4:
                    puffs_to_create = 4
                    
                    while puffs_to_create and settings_list[PARTICLES]:
                        puffs_to_create -= 1
                        temp_puff = particle.SmokeParticle(self.position, (1, 0))
                        temp_puff.velocity.set_angle(359 * random.random())
                        self.effects_group.add(temp_puff)

            else:
                self.current_sequence = 0
                self.process_ai()

        if self.health <= 0:
            self.active = False
            self.die()
            
            if not self.gave_bonus:
                self.world.give_bonus()
                self.gave_bonus = True
Beispiel #2
0
    def die(self):
        if self.object_collided_with.actor_type == ACTOR_TYPE_BAAKE:
            if settings_list[PARTICLES]:
                stars_to_create = 1

                while stars_to_create:
                    stars_to_create -= 1
                    temp_puff = particle.SmokeParticle(self.position, (1, 0))
                    temp_puff.velocity.set_angle(359 * random.random())
                    self.effects_group.add(temp_puff)

        self.kill()
Beispiel #3
0
    def die(self):
        self.stunned -= 1
        self.velocity[1] += .1
        self.world.pause_spawning = 1 * FRAMES_PER_SECOND

        if settings_list[PARTICLES] and not self.stunned % 2:
            puffs_to_create = 4
            
            while puffs_to_create and settings_list[PARTICLES]:
                puffs_to_create -= 1
                temp_puff = particle.SmokeParticle(self.position, (1, 0))
                temp_puff.velocity.set_angle(359 * random.random())
                self.effects_group.add(temp_puff)
Beispiel #4
0
    def actor_update(self):
        if not self.stunned:
            try:
                self.emitter.update()

            except:
                pass

        utility.play_music(self.music, True)
        if not self.active and self.health > 0:
            self.active = True

        if self.life_timer <= 30 * FRAMES_PER_SECOND and self.health == self.world.level + 2:
            if self.life_timer == 30 * FRAMES_PER_SECOND:
                temp_image = self.how_to_kill
                help_bubble = infobubble.InfoBubble(temp_image, self.target, 5 * FRAMES_PER_SECOND)
                help_bubble.offset = vector.Vector2d(0.0, -100.0)
                self.text_group.add(help_bubble)

            self.life_timer += 1

        if self.active:
            if self.stunned:
                self.stunned -= 1

                if not self.stunned % 4:
                    puffs_to_create = 4
                    
                    while puffs_to_create and settings_list[PARTICLES]:
                        puffs_to_create -= 1
                        temp_puff = particle.SmokeParticle(self.position, (1, 0))
                        temp_puff.velocity.set_angle(359 * random.random())
                        self.effects_group.add(temp_puff)

                if not self.stunned:
                    self.animation_list.play('idle')

            else:
                self.current_sequence = 0
                self.process_ai()

        if self.health <= 0:
            self.active = False
            self.die()
            
            if not self.gave_bonus and self.world.world_name != 'Tutorial':
                self.world.give_bonus()
                self.gave_bonus = True
Beispiel #5
0
    def die(self):
        self.emitter = None
        
        if self.world.world_name == 'Tutorial':
            self.world.boss_dead = True

        self.velocity[1] += .1
        self.bound_style = BOUND_STYLE_CUSTOM

        self.stunned -= 1
        self.world.pause_spawning = 1 * FRAMES_PER_SECOND

        if settings_list[PARTICLES] and not self.stunned % 2:
            puffs_to_create = 4
            
            while puffs_to_create and settings_list[PARTICLES]:
                puffs_to_create -= 1
                temp_puff = particle.SmokeParticle(self.position, (1, 0))
                temp_puff.velocity.set_angle(359 * random.random())
                self.effects_group.add(temp_puff)
Beispiel #6
0
    def die(self):
        if self.dying == 0:
            death_type = int(random.random() * 3)

            if death_type == 0:
                temp_image = text.TextSurface(FONT_PATH, 30, FONT_COLOR,
                                              'Blast!').image
                utility.play_sound(self.death_sound[0], OW_CHANNEL)

            elif death_type == 1:
                temp_image = text.TextSurface(FONT_PATH, 30, FONT_COLOR,
                                              'Oh No!').image
                utility.play_sound(self.death_sound[1], OW_CHANNEL)

            elif death_type == 2:
                temp_image = text.TextSurface(FONT_PATH, 30, FONT_COLOR,
                                              'Bother!').image
                utility.play_sound(self.death_sound[2], OW_CHANNEL)

            self.animation_list.play('Die')
            self.bounds = -1000, -1000, SCREEN_WIDTH + 1000, SCREEN_HEIGHT + 32
            self.bound_style = BOUND_STYLE_CUSTOM

            help_bubble = infobubble.InfoBubble(temp_image, self,
                                                5 * FRAMES_PER_SECOND)
            help_bubble.offset = vector.Vector2d(0.0, -100.0)
            self.bullet_group.add(help_bubble)

        self.dying += 1

        if settings_list[PARTICLES] and not self.dying % 2:
            puffs_to_create = 4

            while puffs_to_create:
                puffs_to_create -= 1
                temp_puff = particle.SmokeParticle(self.position, (1, 0))
                temp_puff.velocity.set_angle(359 * random.random())
                self.effects_group.add(temp_puff)