Stopping an animation

I am writing an activity for similar triangles. I am using a pool table simulation to help demonstrate similar triangles I would love to find a way to stop the animation when the ball enters the pocket. For the slide in the link students are required to use 3 bumpers before the ball enters the required pocket. I have a function on the graphing calculator that is 1 normally but when it goes into the required pocket the value changes to 0. Let me know if you have any ideas.

I have figured out how to stop the animation (a_0). I had to determine the distance (d_ball) the ball traveled by using trig and the good old Pythagorean Theorem. After that, I found the rate ball and then determined with any given distance how long it would take the ball to travel to enter the required pocket (t_ime). I used the median function to stop the animation.
a_0 = median(0, 4*t_0, t_ime)

Below is the revised slide.

The whole activity is found in the link below.

Thanks for sharing! Appreciated.