Tarea 6: auto con movimiento
De Casiopea
Título | auto en movimiento |
---|---|
Palabras Clave | tarea 6 |
Período | 2012-2012 |
Asignatura | Imagen Escrita 2012, |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Eduardo Andrés Segovia Jeria |
Profesor | Herbert 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