int x,y; void setup(){ size(300,300); } void loop(){ background(255,255,255); rect(x,y,20+x,20+y); } void keyPressed(){ if(key==UP){ y =y-4; } if(key==DOWN){ y =y+4; } if(key==RIGHT){ x=x+4; } if(key==LEFT){ x=x-4; } }