Added collision check with lower boundary to reset the ball's position