int x,y; void setup(){ size(200,200); } void draw(){ background(230); x=mouseX-25; y=mouseY-25; rect(x,y,50,50); }