'Checks for collisions when Mario moves along the y-axis'

def check_mario_y_collisions(self):

    ground_step_or_pipe = pg.sprite.spritecollideany(self.mario, self.ground_step_pipe_group)
    enemy = pg.sprite.spritecollideany(self.mario, self.enemy_group)
    shell = pg.sprite.spritecollideany(self.mario, self.shell_group)
    brick = pg.sprite.spritecollideany(self.mario, self.brick_group)
    coin_box = pg.sprite.spritecollideany(self.mario, self.coin_box_group)
    powerup = pg.sprite.spritecollideany(self.mario, self.powerup_group)
    (brick, coin_box) = self.prevent_collision_conflict(brick, coin_box)
    if coin_box:
        self.adjust_mario_for_y_coin_box_collisions(coin_box)
    elif brick:
        self.adjust_mario_for_y_brick_collisions(brick)
    elif ground_step_or_pipe:
        self.adjust_mario_for_y_ground_pipe_collisions(ground_step_or_pipe)
    elif enemy:
        if self.mario.invincible:
            setup.SFX['kick'].play()
            enemy.kill()
            self.sprites_about_to_die_group.add(enemy)
            enemy.start_death_jump(c.RIGHT)
        else:
            self.adjust_mario_for_y_enemy_collisions(enemy)
    elif shell:
        self.adjust_mario_for_y_shell_collisions(shell)
    elif powerup:
        if (powerup.name == c.STAR):
            setup.SFX['powerup'].play()
            powerup.kill()
            self.mario.invincible = True
            self.mario.invincible_start_timer = self.current_time
    self.test_if_mario_is_falling()
