# Making a shape move

**URL:** https://discourse.processing.org/t/making-a-shape-move/22026
**Category:** Beginners
**Created:** [June 20, 2020, 2:52pm UTC](https://discourse.processing.org/t/making-a-shape-move/22026 "2020-06-20T14:52:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![klap](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@klap](https://discourse.processing.org/u/klap)
#### Post date: [June 20, 2020, 2:52pm UTC](https://discourse.processing.org/t/making-a-shape-move/22026/1 "2020-06-20T14:52:27Z")

</div>

I wonder why my plane is not moving. Lockdown for planes is over isn’t it? 😉

```auto
  
//noStroke();
//50
float planeX;
float planeY;

void setup() {
  
  size(1000,700);
  planeX = width/32;
 planeY = height/18;
  
}

void draw() {
    background(255);

for (int i=600; i <0; i--) {
  
 translate(i, 0);

beginShape(QUADS);

fill(#B22694);
//tegenklok, 1ste quad onder
vertex(planeX*2, planeY*2.6);
vertex(planeX*4, planeY*3);
vertex(planeX*4.6, planeY*2.6);
vertex(planeX*4, planeY*1.8);
//metklokmee, tweede quad boven
vertex(planeX*2, planeY*2.6);
vertex(planeX*2.2, planeY*1.8);
vertex(planeX*2.8, planeY*1.4);
vertex(planeX*4, planeY*1.8);
//println(planeY*1.8);

//endShape();
endShape();

beginShape(TRIANGLES);
//tegenklok, staart
vertex(planeX*4, planeY*1.8);
vertex(planeX*4, planeY);
vertex(planeX*3.2, planeY*1.9);

//middenstuk tegenklok, start staart
vertex(planeX*4, planeY*1.8);
vertex(planeX*2.4, planeY*2);
vertex(planeX*1.4, planeY*2.9);

//onderste puntje neus, rechtsom, begin bij 1ste vertex van 1ste quad
vertex(planeX*2.06, planeY*2.64);
vertex(planeX*2.44, planeY*2.68);
vertex(planeX*1.4, planeY*2.9);

//bovenste driehoekje, klok mee
fill(#431639);
vertex(planeX*2.2, planeY*1.8);
vertex(planeX*2.7, planeY*1.34);
vertex(planeX*2.8, planeY*1.4);

//onderstevliegtuigje, klok tegen
fill(#431639);
vertex(planeX*4, planeY*3);
vertex(planeX*4.6, planeY*2.6);
vertex(planeX*4.58, planeY*2.5);
  
endShape();
//}
}
  
}

```

---

<div class="post-metadata">

### Author: ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)
#### Post date: [June 20, 2020, 2:58pm UTC](https://discourse.processing.org/t/making-a-shape-move/22026/2 "2020-06-20T14:58:50Z")

</div>

> [@klap](#):
>
> ```auto
> void draw() {
> background(255);
> 
> for (int i=600; i <0; i--) {
>   
> translate(i, 0);
> 
> ```

Translate moves the coordinate system forward, but the whole for loop is cover in one draw()-cycle. So in 1/60 seconds you draw all those element 600 times.

To make those element move remove for loop and just increase i in draw()-function

Perhaps like this

```auto
i++;
if(i>600) {
  i=0;
}

```
