//decouple from mouse float mattX=50, mattY=50; float goldX,goldY; void setup() { // Set the size of the window size(500,500); smooth(); // The frame rate is set to 30 frames per second. frameRate(30); } void draw() { // Draw a black background background(255); mattX = mouseX; mattY = mouseY; // Set ellipses and rects to CENTER mode ellipseMode(CENTER); rectMode(CENTER); // body stroke(0); fill(2,60,203); rect(mattX,mattY,20,100); // head stroke(0); fill(25,234,75); ellipse(mattX,mattY-30,60,60); // helmet stroke(0); fill(25,234,75); rect(mattX,mattY-40,60,60); // eyes fill(0); ellipse(mattX-19,mattY-30,16,32); ellipse(mattX+19,mattY-30,16,32); // eye center fill(23,137,206); ellipse(mattX-19,mattY-30,8,16); ellipse(mattX+19,mattY-30,8,16); // legs stroke(0); line(mattX-10,mattY+50,mattX-10,mattY+60); line(mattX+10,mattY+50,mattX+10,mattY+60); // feet stroke(0); line(mattX-15,mattY+60,mattX-10,mattY+60); line(mattX+15,mattY+60,mattX+10,mattY+60); // feet stroke(0); line(mattX-15,mattY+60,mattX-10,mattY+60); line(mattX+15,mattY+60,mattX+10,mattY+60); }