Francisca Rojas tarea 6

De Casiopea
La versión para imprimir ya no se admite y puede contener errores de representación. Actualiza los marcadores del navegador y utiliza en su lugar la función de impresión predeterminada del navegador.
Tarea 6


TítuloTarea 6
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 6
AsignaturaTaller Inicial 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasDiseñ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)Francisca Rojas
ProfesorHerbert Spencer

circulos en movimiento, recorriendo el eje x.

// basado en proyecto de Daniel Morris //Objeto: pelota Pelota laPelota; Pelota laPelota2; Pelota laPelota3; Pelota laPelota4; Pelota laPelota5; Pelota laPelota6;


void setup() {

 size(700,300);
 laPelota = new Pelota(color(#f3b1c1), 0,20, 20);
 laPelota2 = new Pelota(color(#c11f45), 0, 80,10);
 laPelota3 = new Pelota (color(#dd2a54), 0, 125, 15);
 laPelota4 = new Pelota (color(#e24c6f), 0, 175, 20);
 laPelota5 = new Pelota (color(#e86e8a), 0, 225, 10);
 laPelota6 = new Pelota (color(#ed8fa5), 0, 275, 15);
 

}

//El comando draw hace que finalmente las pelotas aparezcan en escena. void draw() {

 background(#180408);
 laPelota.move();
 laPelota.display();
 laPelota2.move();
 laPelota2.display();
 laPelota3.move();
 laPelota3.display();
 laPelota4.move();
 laPelota4.display();
 laPelota5.move();
 laPelota5.display();
 laPelota6.move();
 laPelota6.display();

}


class Pelota { //variables de la pelota

   color c; //el color
 float xpos; //la posición en x
 float ypos; //la posición en y
 float xspeed; //la velocidad que tendrá al moverse en el eje de las x
 Pelota(color tempC, float tempXpos, float tempYpos, float tempXspeed) { //estas son las variables
   c = tempC;
   xpos = tempXpos;
   ypos = tempYpos;
   xspeed = tempXspeed;
 }
 void display() { //la función a usar
   stroke(100);
   rectMode(CENTER);
   fill(c);
   ellipse(xpos, ypos, 100,100);
 }
 void move() { 
   xpos = xpos + xspeed;
   if(xpos> width) {
    xpos=0;
   }
 }

}

void keyPressed() {

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

}