María Jesús Arestizábal Tarea 6

De Casiopea
Tarea 6


TítuloTarea 6
Palabras Clavetarea 6
AsignaturaImagen Escrita 2012,
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)María Jesús Arestizábal

// Construcción de un método que aumente la expresión del dibujo Se trata de construir una máquina que aumente la expresión del dibujo, a través de variables como la posición, la velocidad, la inclinación, etc.

Elemento[] cosas; int count;

Elemento especial;

void setup() {

cosas = new Elemento[16]; count = 0; size(800,700); background(467); especial = new Elemento(width/4, height/5); especial.c = color(120, 999); especial.d = 10; especial.velx = 4; especial.vely = 200 ; especial.edadMax = 100; }

void draw() {

for (int i = 0; i < count; i++) {

 cosas[i].existe();

} especial.existe(); }


class Elemento {

float x, y; float d; color c; float velx, vely; int edadMax; int edad; Elemento(float posX, float posY) {

 x = posX;
 y = posY;
 c = color(#5904BC, #2E04BC, #1923CE, #197BCE);
 velx = vely = 0;
 edadMax = round(random(100, 10));
 edad = 0;
 d = random(1, 70);

} Elemento() {

 x = random(width);
 y = random(height);
 c = color(#04B404, 80, 115, 20);
 velx = vely = 0;
 edadMax = round(random(100, 200));
 edad = 0;
 d = random(1, 30);

} void dibuja() {

 noStroke();
 fill(c);
 ellipse(x+2,y+3, 110, 110);
 edad ++;
 d -= 50;

} void actualizaPosicion() {

 x += velx;
 y += vely;

} void revisaSiRebota() {

 if ((x < d/50) || (x > width - (d/50))) {
   velx *= -1;
   vely += random(-1, 1);
 }
 if ((y < d/70) || (y > height - (d/70))) {
   vely *= -1;
   velx += random(-1, 1);
 }

} void existe() {

 if (edad < edadMax) {
   dibuja();
   actualizaPosicion();
   revisaSiRebota();
 }

} }