xxxxxxxxxx
/*-----------------------------
Robot
This creates a drawing of a robot.
Created 19 Jan 2017
By Tamara Sabbagh
tamara.sabbagh@gmail.com
Modified 19 Jan 2017
By Tamara Sabbagh
https://www.openprocessing.org/sketch/400018
-----------------------------*/
function setup() {
createCanvas(400, 400);
background(255);
}
function draw() {
rectMode(CENTER);
fill(255, 255, 153);
rect(200, 100, 50, 50); //head
triangle(163, 125, 145, 175, 126, 170); //top left arm
quad(125, 170, 91, 190, 110, 208, 145, 175); //bottom left arm
triangle(238, 125, 275, 175, 255, 175); //top right arm
quad(258, 182, 291, 210, 309, 190, 275, 172); //bottom right arm
fill(255, 0, 0, 30);
rect(200, 175, 75, 100); //body
fill(255, 255, 153);
rect(175, 263, 25, 75); //leg
rect(225, 263, 25, 75); //leg
fill(0);
rect(225, 305, 35, 10); //rightfoot
rect(175, 305, 35, 10); //leftfoot
fill(186, 46, 238, 60);
triangle(225, 200, 200, 150, 175, 200);
fill(186, 46, 238);
ellipseMode(CENTER);
ellipse(100, 200, 25, 25); //hand
ellipse(300, 200, 25, 25); //hand
ellipse(265, 175, 20, 20); //elbow
ellipse(135, 175, 20, 20); //leftelbow
fill(255, 0, 0);
ellipse(190, 95, 10, 10); //lefteye
ellipse(210, 95, 10, 10); //righteye
}