xxxxxxxxxx
48
let stick;
let carrot;
// Load the image.
function preload() {
stick = loadImage("/assets/arm.png");
carrot = loadImage("/assets/nose.png");
}
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
//Head
push();
stroke(255, 0, 0);
translate(width / 2, height / 5);
circle(0, 0, width / 3);
pop();
//Left arm
push();
translate(0, 0);
image(stick, 0, 0);
pop();
//Right arm
push();
translate(0, 0);
image(stick, 0, 0);
pop();
//Body
push();
stroke(255, 0, 0);
translate(width / 2, height / 2);
circle(0, 0, width / 2);
pop();
//Legs
push();
stroke(255, 0, 0);
translate(width / 2, height);
circle(0, 0, width);
pop();
}