float x = 400, y=100;
int a=20,b=10;
void setup() { size(800, 200); }
void draw() {
rect(x-10, y-5, a, b);
}
void keyPressed() {
  int k=' ';
if (keyCode == RIGHT) {
x++;
} else if (keyCode == LEFT) {
x--;
} else if (keyCode == UP){
  y--;
} else if (keyCode == DOWN){
  y++;
}
}