/* donatello.pde //<>// //<>// Edited by Sam Wolfson, Justin Hsia (orig. Larry Synder) Draws an abstracted Teenage Mutant Ninja Turtle. Later, we add motion. */ // int xPos = width-40; // start at right edge of canvas int xPos = 100; // start on left side of canvas void setup() { size(500, 500); noStroke(); } void draw() { background(255, 245, 220); // Donatello fill(0, 100, 0); // dark green rect(xPos, 182, 40, 15); // top of head fill(88, 44, 141); // purple rect(xPos, 197, 40, 6); // bandana mask fill(0, 100, 0); // dark green rect(xPos, 203, 40, 20); // bottom of head fill(219, 136, 0); // dark yellow rect(xPos, 223, 40, 50); // shell fill(0, 100, 0); // dark green rect(xPos, 273, 40, 45); // lower body //xPos = xPos + 1; // move to the right slowly //xPos = xPos - 1; // move to the left slowly xPos = min(xPos + 5, width-40); // move right, but stop at edge //xPos = max(xPos - 1, 0); // move left, but stop at edge }