Change the angle of the 2 "lines" with the sliders on top. Press space to start and wait till the ball touches the edge to "test" again. The ball will point towards your mouse and start moving when you start the "test".
The code for this isn't really the best if you try it on anything other than lines so if you wish to use this in your game you gotta make sure you really understand it first to be able to easily make changes to it, but don't worry cause I'll explain: 1)it checks your direction and transforms it into 2 different velocities(useful if you wish to add gravity or speed loss) 2)it moves the ball in that direction until it touches a line(sprite 2 and 6 in this case) 3)slowly moves the ball back until it's not touching the line anymore 4)see inside and check sprite1(i left notes on what that math does) 5)do whatever you want with it