# Bubble shooting game

**URL:** https://discourse.processing.org/t/bubble-shooting-game/10919
**Category:** Libraries
**Tags:** homework
**Created:** [May 4, 2019, 8:59pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919 "2019-05-04T20:59:10Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![Argonui](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/argonui/32/5071_2.png) [@Argonui](https://discourse.processing.org/u/Argonui)
#### Post date: [May 8, 2019, 12:14pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/23 "2019-05-08T12:14:14Z")

</div>

I can’t send you the code

---

<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: [May 8, 2019, 12:26pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/24 "2019-05-08T12:26:16Z")

</div>

The variable is set in my first code above

---

<div class="post-metadata">

### Author: ![yoyo18](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yoyo18](https://discourse.processing.org/u/yoyo18)
#### Post date: [May 8, 2019, 1:01pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/25 "2019-05-08T13:01:48Z")

</div>

I’m Argonui using the account of Yoyo. (cause only 3 reply for us)  
Your first code is just above the second and it’s is not working cause it never write “hit” when the ball crosses eachother.  
here a link to the code of collisions and the array of the blue ball :  
[https://textup.fr/336087HB](https://textup.fr/336087HB)

---

<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: [May 8, 2019, 1:04pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/26 "2019-05-08T13:04:18Z")

</div>

my code above write hit all the time, just tested it

please post your entire code

I have to go now, I am sorry

---

<div class="post-metadata">

### Author: ![yoyo18](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yoyo18](https://discourse.processing.org/u/yoyo18)
#### Post date: [May 8, 2019, 1:22pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/27 "2019-05-08T13:22:33Z")

</div>

Thx for your help  
here’s the whole code :  
[https://textup.fr/336096hA](https://textup.fr/336096hA)

---

<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: [May 8, 2019, 3:05pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/28 "2019-05-08T15:05:04Z")

</div>

the answer is simple

this is the hit code

```auto
    for (int i = uniteB.size()-1; i >= 0; i--) {
      bleu ball1 = (bleu) uniteB.get(i);
      if (ball1.isAlive) {
        for (int i1 = uniteR.size()-1; i1 >= 0; i1--) {
          rouge ball2 = (rouge) uniteR.get(i1);
          if (ball2.isAlive && dist(ball1.x, ball1.y, ball2.x, ball2.y) < 7) {
            text("hit", ball1.x, ball1.y);
            ball1.isAlive=false;
            ball2.isAlive=false;
            print("HIT");
          }//if
        }//for
      }//if
    }//for

```

It uses x,y of the class blue and rouge

BUT you don’t change x,y because of a crazy deplacementR / deplacementB in the class

In my code I got rid of those and put x,y right.

Hence it works

I have to go now, I am sorry

Chrisir

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 8, 2019, 4:18pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/29 "2019-05-08T16:18:18Z")

</div>

> [@Argonui](#):
>
> I can’t send you the code

Your posts were blocked as spam. I have approved one of the code posts.

Please format your forum code with highlight + \</\> button.

---

<div class="post-metadata">

### Author: ![yoyo18](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@yoyo18](https://discourse.processing.org/u/yoyo18)
#### Post date: [May 8, 2019, 5:00pm UTC](https://discourse.processing.org/t/bubble-shooting-game/10919/30 "2019-05-08T17:00:16Z")

</div>

Thx man that was so easy to find. Sry for bored you with that i could have find it myself. Thx for all the help really.

Ok jeremy i’ll know it now.

[Previous page](https://discourse.processing.org/t/bubble-shooting-game/10919.md?page=1)
