# Logic on making a circle disappear when clicked and drawing another circle at the same time

**URL:** https://discourse.processing.org/t/logic-on-making-a-circle-disappear-when-clicked-and-drawing-another-circle-at-the-same-time/35066
**Category:** Coding Questions
**Created:** [February 9, 2022, 6:01pm UTC](https://discourse.processing.org/t/logic-on-making-a-circle-disappear-when-clicked-and-drawing-another-circle-at-the-same-time/35066 "2022-02-09T18:01:24Z")
**Posts on this page:** 1
**Showing post:** 19

<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: [April 6, 2022, 8:42pm UTC](https://discourse.processing.org/t/logic-on-making-a-circle-disappear-when-clicked-and-drawing-another-circle-at-the-same-time/35066/19 "2022-04-06T20:42:57Z")

</div>

I recommend you look at screenX and implement it

for p5

see [Mouse interaction with 3D objects / objects on 3D plane - #2 by Chrisir](https://discourse.processing.org/t/mouse-interaction-with-3d-objects-objects-on-3d-plane/19499/2)

In processing JAVA flavor you can say

```auto
theX=screenX (.........
theY=screenY (.........

```

and later

```auto

if(dist(mouseX,mouseY,theX,theY)<40) {
     // hit
}

```

---

_[View the full topic](https://discourse.processing.org/t/logic-on-making-a-circle-disappear-when-clicked-and-drawing-another-circle-at-the-same-time/35066)._
