xxxxxxxxxx
65
/*
p5 shapes example
by yana
10.28.2024
*/
// runs once, before the programs starts drawing
function setup() {
createCanvas(400, 400);
}
// runs 60 fps, constantly drawing and updating our graphics
function draw() {
background(220);
// add some color
// colorMode(HSB);
// fill(290, 80, 80);
// css values go in quotation marks ""
fill("pink");
noStroke();
// shapes
// body
rectMode(CENTER);
square(200, 200, 40, 10)
// head
circle(200,170,40)
fill("#FAE69D");
// eyes
circle (190,170,10)
circle (210,170,10)
noStroke();
fill("pink");
// legs
circle (190,225,10)
circle (190+20,225,10)
noStroke();
fill("pink");
// hands
circle (175,195,10)
circle (175+50,195,10)
noStroke();
fill("pink");
}
// save an image of the canvas
function mousePressed() {
save("character.jpg");
}