// Set up variables float xVal = 60; float yVal = 440; int myHeadRadius = 45; int myBodyHeight = 180; int myBodyWidth = 90; int myNeckHeight = 40; // Our text included this without using it... float easingVal = 0.04; void setup() { size(360,480); ellipseMode(RADIUS); // draw ellipse from center } void draw() { strokeWeight(2); background(0, 153, 204); // Blue translate(mouseX, yVal); // Move all to myNewX // Toggle the scale of everything if (mousePressed) { scale(1.0); } else { scale(0.6); } // Body noStroke(); fill(255, 204, 0); // Orange ellipse(0, -33, 33, 33); // The wheel fill(0); // Black // Calculate the rect for the body relative to the 0,0 center rect(-myBodyWidth/2, -myBodyHeight, myBodyWidth, myBodyHeight-33); // // Neck // Set the y location of the neck relative to the size of the // other components float myNeckY = -1 * (myBodyHeight + myNeckHeight + myHeadRadius); stroke(255); // White line(12, -myBodyHeight, 12, myNeckY); // Hair pushMatrix(); // Isolate translation and rotation // translate from the middle of the head translate(12, myNeckY); // set myAngle to 1/30th of half way around float myAngle = -PI/30.0; for (int i = 0; i <= 30; i++) { // do these statement 30 times, rotating a bit each time line(80, 0, 0, 0); rotate(myAngle); } popMatrix(); // end isolation of translate and rotate // Head noStroke(); // Black head circle fill(0); // Black ellipse(12, myNeckY, myHeadRadius, myHeadRadius); // White eyeball fill(255); // White int eyeSize = 14; ellipse(24, myNeckY-6, eyeSize, eyeSize); // Green Iris fill(0, 200, 200); // Green ellipse(24, myNeckY-6, eyeSize*0.66,eyeSize*0.66); // Black pupil fill(0); // Black ellipse(24, myNeckY-6, eyeSize*0.33,eyeSize*0.33); }