//Eveline Lai //processing barbie //Almost every girl growing up has played the paper dolls with the cut-out outfits that can be changed. I like the idea that i can just use the mouse position to change the look of the outfit of the barbie doll through processing. float xpos1 = 134; float xpos2 = 44; float xpos3 = 58; float xpos4 = 120; float xpos5 = 200; float xpos6 = 300; PImage barbie; void setup() { size(400, 400); noStroke(); barbie= loadImage ("barbie.gif"); smooth(); } void draw() { background(255); float mx = mouseX * 0.4 - width/5.0; fill(0); rect(xpos2, 0, 50, height); fill(220); rect(xpos1, 0, 10, height); fill(0); rect(xpos4, 0, 50, height); fill(220); rect(xpos3, 0, 10, height); fill(175); rect (xpos5, 0, 30, height); fill (175); rect (xpos6, 0, 30, height); xpos1 += mx/16; xpos2 += mx/64; xpos6 += mx/30; xpos3 -= mx/16; xpos4 -= mx/64; xpos5 -= mx/30; if(xpos1 < -10) { xpos1 = width; } if(xpos1 > width) { xpos1 = -10; } if(xpos2 < -60) { xpos2 = width; } if(xpos2 > width) { xpos2 = -60; } if(xpos3 < -10) { xpos3 = width; } if(xpos3 > width) { xpos3 = -10; } if(xpos4 < -60) { xpos4 = width; } if(xpos4 > width) { xpos4 = -60; } if(xpos5 < -30) { xpos5 = width; } if(xpos5 > width) { xpos5 = -30; } if(xpos6 < -30) { xpos6 = width; } if(xpos6 > width) { xpos6 = -30; } image (barbie, 0, 0); }