color c = color(255);
float x = 0;
float y = 300;
float speed = 4;
float x = 0;
float y = 300;
float speed = 4;
void setup() {
size(600,600);
}
size(600,600);
}
void draw(){
background(0);
move();
display();
}
background(0);
move();
display();
}
void move() {
x = x + speed;
if (x > width) {
x = 0;
}
}
x = x + speed;
if (x > width) {
x = 0;
}
}
void display() {
fill(c);
rect(x,y,30,10);
}
fill(c);
rect(x,y,30,10);
}
No hay comentarios.:
Publicar un comentario