# A game where there are circles and you press on them and they dissapear in processing

**URL:** <https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729>\
**Category:** Coding Questions\
**Created:** [November 26, 2020, 1:41pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729 "2020-11-26T13:41:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakeTheFake](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JakeTheFake](https://discourse.processing.org/u/JakeTheFake)\
**Post date:** [November 26, 2020, 1:41pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/1 "2020-11-26T13:41:49Z")

</div>

I need help, could someone give me code for processing not j5.js for a game that has circles where you press on them and they dissapear please. I really need an example asap and it would be amazing if you could give me one. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 26, 2020, 3:52pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/2 "2020-11-26T15:52:11Z")

</div>

You need an ArrayList for that.  
KevinWorkman has a really good blog with a lot of tutorials.  
Just study this one, and adapt it to your need.

> **[ArrayLists](https://happycoding.io/tutorials/processing/arraylists)**
>
> Learn how to use ArrayLists in Processing.

---

<div class="post-metadata">

**Author:** ![JakeTheFake](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JakeTheFake](https://discourse.processing.org/u/JakeTheFake)\
**Post date:** [November 26, 2020, 5:34pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/3 "2020-11-26T17:34:14Z")

</div>

Could you please send me the code though please.

---

<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:** [November 26, 2020, 5:59pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/4 "2020-11-26T17:59:27Z")

</div>

Please show your attempt

It is policy not to give full code solutions

I am sorry!

Here is an example

```auto

//------------------------------------------------------------------------------------

void setup() {
  size(600, 600);
  background(255);// white
  textSize(25);
  fill(255, 0, 0);
}

void draw() {
  background(255);// white

  text("O", 33, 44); 
  text("O", 133, 144);
  text("O", 233, 44);
  text("O", 233, 444);
}

```

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [November 26, 2020, 6:18pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/5 "2020-11-26T18:18:22Z")

</div>

[Studio.ProcessingTogether.com/sp/pad/export/ro.9NGjx94YMTtlu](http://Studio.ProcessingTogether.com/sp/pad/export/ro.9NGjx94YMTtlu)

---

<div class="post-metadata">

**Author:** ![JakeTheFake](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JakeTheFake](https://discourse.processing.org/u/JakeTheFake)\
**Post date:** [November 26, 2020, 7:03pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/6 "2020-11-26T19:03:14Z")

</div>

Sorry, here is my attempt:

```auto
void setup() {
size(500,800);
background(0,0,0);

}
void draw() {

  if (mousePressed == true) {
  background(0,0,0);
}
}

void keyPressed() {
  if (key == CODED) {
    if (keyCode == UP) {
     
ellipse(random(500),random(800),100,100);      
fill(216,191,216);
ellipse(250,500,100,100);
    } 
    
  }
}

```

Its pretty bad but I tried my best

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 26, 2020, 7:11pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729/7 "2020-11-26T19:11:38Z")

</div>

You have to study the ArrayList.  
Even a working code is given above.
