'Fireball collisions along y axis'

def check_fireball_y_collisions(self, fireball):

    collide_group = pg.sprite.Group(self.ground_group, self.pipe_group, self.step_group, self.coin_box_group, self.brick_group)
    collider = pg.sprite.spritecollideany(fireball, collide_group)
    enemy = pg.sprite.spritecollideany(fireball, self.enemy_group)
    shell = pg.sprite.spritecollideany(fireball, self.shell_group)
    if (collider and (fireball in self.powerup_group)):
        fireball.rect.bottom = collider.rect.y
        self.bounce_fireball(fireball)
    elif enemy:
        self.fireball_kill(fireball, enemy)
    elif shell:
        self.fireball_kill(fireball, shell)
