Sebastián Aguilera tarea 6

De Casiopea


TítuloSebastián Aguilera tarea 6
Palabras Clavetarea 6
AsignaturaTaller Inicial Común 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasArquitectura, Diseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Sebastián Aguilera
ProfesorHerbert Spencer

// Tomado en base a tarea de Gabriela torres

Car myCar;


void setup() {

 size(700, 700);   
 colorMode (HSB);  
 myCar = new Car();

}

void draw() {

 background(0);


 myCar.move(); 
 myCar.display();


 if (key == 's') {
   saveFrame("######.jpg");
 }

}

class Car {

 color c; 
 float xpos;
 float ypos;
 float xspeed;
 Car() { 
   xpos = width/7;
   ypos = height/6;
   xspeed = 5;
 }
 void display() {
   float c;    //agregamos la psicodelia
   c = random(9,1000);   // c se define en un número aleatorio entre 0 y 359
   rectMode(ROUND); 
   noStroke ();
   fill (c, 60, 480);  // usamos c para el relleno del objeto 
   ellipse(mouseX, xpos, mouseY, xpos);  //definimos el objeto como un elipse
 }
 void move() { 
   xpos = xpos + xspeed;
   if (xpos > height) {
     xpos = 4;
   }
 }

}