This line in your ball script is making it go straight forward:
apply_impulse(Vector3(rand_range(-10,10),rand_range(-10,10),rand_range(-10,10)),Vector3(0,0,-15))
The last vector is just moving along the negative z, so will always move straight:
Vector3(0,0,-15)
You need to make a function on the ball that accepts the mouse position from the main script (at the time when you instance it). Then when it moves it would move based on the x/y of the mouse, not 0, 0.