xxxxxxxxxx
43
function setup() {
createCanvas(800, 500);
}
function draw() {
background(220);
drawCreature(width/2, height/2);
}
function drawCreature(x, y) {
push();
translate(x, y);
drawBody(0, 0, 0, 1.0);
drawArm(-60, 20, PI*1.25, 1.0);
drawArm(60, 20, PI*1.75, 1.0);
pop();
}
function drawBody(x, y, a, s) {
push();
translate(x, y);
rotate(a);
scale(s);
ellipse(0, 0, 150, 200);
ellipse(-20, -30, 5, 5);
ellipse(20, -30, 5, 5);
ellipse(0, 10, 40, 40);
pop();
}
function drawArm(x, y, a, s) {
push();
translate(x, y);
rotate(a);
scale(s);
ellipse(40, 0, 100, 20);
ellipse(0, 0, 5, 5);
pop();
}