xxxxxxxxxx
int a;
int b;
boolean direction;
void setup() {
size(640, 360);
colorMode(RGB, random(255));
a = random(0);
b = width;
direction = true;
frameRate(60);
}
void draw() {
a++;
if(direction == true){
stroke(0, 0, random(255));
} else {
stroke(width-a);
}
fill(0, 0, 255);
rect(0, 0, a, height/2);
b--;
if(b < 0) {
b = width;
}
if(direction == true) {
stroke(255, 255, 0);
} else {
stroke(255, 255, 0);
}
fill(255, 255, 0);
rect(b, height/2, a, height/2);
}