Burst Your Bubble - I can burst it but not correctly

Hi, first post here. Loving the app.

I just completed the Burst Your Bubble puzzle except that something doesn’t click for me: Why is there an .interrupt() inside the blow function? If I’m not mistaken the .interrupt() should be inside the burst function, which is what I did because that’s the function that actually interrupts the transition. I solved it of course, it’s a simple one. However…

I erased the first .interrupt() from the blow function just to see if I was right, and it works, it behaves the same as if it were there. So my question is: Why is it necessary in the first place?

I’ll appreciate any help,

1 Like

You’re not alone. I saw the same thing and erased just as you did, with the same results.

I’m going to take a guess and blame it on the interpreter. I’ve seen this behavior once before (but can’t recall which module) and came to the SAME conclusion – The interpreter’s rules vs literal-language.

Would be nice for an official to chime-in on this.

1 Like

@robmerc As we introduce new concepts and keys, we try to have one example of the concept being used before asking the user to do it themselves. Since .interrupt() hasn’t been seen in any other puzzles, we included it in the starter code.

You’re both correct that it isn’t necessary to have an interrupt in the blow function. Although the blow function can be triggered during the original deflation (the transition right above face.on(‘click’, blow)), it will already interrupt that transition with its own transition. interrupt is only needed if you’re trying to set an attr on an object while the attribute on that object is in the middle of a transition.

This also means that you don’t need to use interrupt on an object if the attr you want to change isn’t part of the transition. You can try taking out all the interrupts and then changing 'cx' to 'cy' in the burst function definition. Blow the bubble then try to pop it – 'cy' will change without the interrupt, but the 'r' will continue to grow until the radius is 500.

I’ll update this puzzle so that you can still pass it if you delete the bubble.interrupt() from the blow function definition, since this doesn’t affect the behavior of the output.