Tarea 6: auto con movimiento

De Casiopea
auto en movimiento


Títuloauto en movimiento
Palabras Clavetarea 6
Período2012-2012
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Eduardo Andrés Segovia Jeria
ProfesorHerbert Spencer

//este trabajo consiste en figuras que construyen un auto y se mueven a la misma velocidad

color c = color(0); float x = 0; float y = 100; float velocidad = 5;//velocidad del auto

void setup() {//tamaño pantalla

 size(900, 200);}

void draw() {

 background(0);
 move();
 display();}

void move() {

 x = x + velocidad;
 if (x > width) {x = 1;  }
 if (y > height) {y = 0;  }}

void display() {

 fill(y);
 ellipse(x+10,140, 20, 20);
 ellipse(x+60,140, 20, 20);
 rect(x, 110,50, 10);rect(x,120,70,20);}//las figuras que conforman el auto