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