Arrays aren't always needed, but they can be useful if you want to keep track of a bunch of numbers. In this case I used it to keep track of the two end positions of a bunch of line segments. Most of the cool stuff is from math and logic.
Anyways, I found a simpler way without much of the math stuff that works with colored bubbles. It uses the paster third party plugin. Basically it uses the "destination out" blend mode to slice off parts of the circles. You could do it without the paster plugin if you had a layer per bubble, but that would be harder to work with. Paster lets you draw to a image so you can use it for more complicated layer composition stuff.
It may be satisfactory as is, but some more work is needed to make clicking select the correct bubble. AKA we'd want to do out own collision detection.
The more I fiddle with ideas, the more impressive the game in the op's video is. They clearly put a lot of work into it.
I tried adding an effect to make a the bubbles more soft, but eh, it doesn't look great.
I'm more convinced a the bubble would look better with soft body physics instead of rigid. A simple way could be to make a bubble out of multiple smaller rigid bodies connected with springs and some forces to keep them from collapsing on themselves. Then we'd stretch the bubble over that so it looks distorted. The paster plugin's draw quad action could help with that. The bubble intersection logic would have to be reworked again though.
It may be enough to just make the collision solver more spongy though. I guess that's the advantage of rolling our own physics, we can tweak stuff like that.
Here are some older topics about soft body physics for possible reference.