void draw() { background(50); fill(255,255,255); rect(0,0,300,rectY_2); fill(255,0,0); rect(0,rectY_2,300,rectY); }
void keyPressed() { if (keyCode == UP) { rectY-=50; rectY_2+=50; } else if (keyCode == DOWN) { rectY+=50; rectY_2-=50; }
}