# Need help with very simple animation new to processing

**URL:** <https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328>\
**Category:** Beginners\
**Created:** [August 12, 2019, 12:05pm UTC](https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328 "2019-08-12T12:05:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heatwave87](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Heatwave87](https://discourse.processing.org/u/Heatwave87)\
**Post date:** [August 12, 2019, 12:05pm UTC](https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328/1 "2019-08-12T12:05:27Z")

</div>

hi I’m really new to processing and I’m just wondering how I could make something like a rectangle for example disappear when I click and come back when I stop holding the click  
if anyone could help me with this I would be really grateful.

---

<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:** [August 12, 2019, 12:13pm UTC](https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328/2 "2019-08-12T12:13:23Z")

</div>

Welcome to the forum!

Have you discovered the reference?

See [https://www.processing.org/reference](https://www.processing.org/reference)

Look at `mousePressed` (without the brackets (), there are two different kinds of `mousePressed`)

**Idea**

say something like :

```auto
if(mousePressed == false) {
    //draw rectangle here
}

```

**Remark:**

Also look at the tutorials section and read the first three text tutorials

e.g. see here: [https://www.processing.org/tutorials/overview/](https://www.processing.org/tutorials/overview/)

**Remark:**

You need the functions setup() and draw() to make an animation.

Here is an example:

```auto
     void setup() {
       size(400, 400);
       stroke(255);
       background(192, 64, 0);
     } 

     void draw() {
       line(150, 25, mouseX, mouseY);
     }

```

Come back here to ask more questions.

Chrisir

---

<div class="post-metadata">

**Author:** ![Heatwave87](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Heatwave87](https://discourse.processing.org/u/Heatwave87)\
**Post date:** [August 14, 2019, 2:02am UTC](https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328/3 "2019-08-14T02:02:05Z")

</div>

thank you this helps a lot 🙂

---

<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:** [August 14, 2019, 1:09pm UTC](https://discourse.processing.org/t/need-help-with-very-simple-animation-new-to-processing/13328/4 "2019-08-14T13:09:21Z")

</div>

> [@Chrisir](#):
>
> if(mousePressed == false) {

Short form:

`if( ! mousePressed ) {`
