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