'Mario collisions with pipes on the y-axis'

def adjust_mario_for_y_ground_pipe_collisions(self, collider):

    if (collider.rect.bottom > self.mario.rect.bottom):
        self.mario.y_vel = 0
        self.mario.rect.bottom = collider.rect.top
        if (self.mario.state == c.END_OF_LEVEL_FALL):
            self.mario.state = c.WALKING_TO_CASTLE
        else:
            self.mario.state = c.WALK
    elif (collider.rect.top < self.mario.rect.top):
        self.mario.y_vel = 7
        self.mario.rect.top = collider.rect.bottom
        self.mario.state = c.FALL
