# Bubble popping animation

**URL:** <https://discourse.processing.org/t/bubble-popping-animation/15341>\
**Category:** Beginners\
**Created:** [November 8, 2019, 8:07pm UTC](https://discourse.processing.org/t/bubble-popping-animation/15341 "2019-11-08T20:07:47Z")\
**Posts on this page:** 1\
**Showing post:** 32

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 3, 2020, 9:29pm UTC](https://discourse.processing.org/t/bubble-popping-animation/15341/32 "2020-06-03T21:29:32Z")

</div>

I think in draw you need nested for loop, to check each bubble against every other bubble:

```auto
  for (int indices = 0; indices < bubbles.length-1; indices += 1) {
  for (int indices2 = indices ; indices2 < bubbles.length; indices2 += 1) {
       if (bubbles [indices].together (bubbles [indices2])) {
           bubbles[indices].pops ();
           bubbles[indices2].pops ();
       }
}
}

```

---

_[View the full topic](https://discourse.processing.org/t/bubble-popping-animation/15341)._
