# Making a shape move

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

``````
//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);

fill(#B22694);
vertex(planeX*2, planeY*2.6);
vertex(planeX*4, planeY*3);
vertex(planeX*4.6, planeY*2.6);
vertex(planeX*4, planeY*1.8);
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();
//}
}

}
``````
1 Like

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

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