xxxxxxxxxx
25
// this function is part of the p5.js library
function setup() {
createCanvas(400, 400);
}
// this function is declared by the user
function smileyFace() {
// fill, circle and arc are p5.js functions
fill('yellow');
circle(200,200,200);
fill('black');
circle(160,170,30);
circle(240,170,30);
arc(200, 230, 80, 80, 0, PI, CHORD);
}
// this function is part of the p5.js library
function draw() {
// background is part of the p5.js library
background('black');
// The user declared function smileyFace is
// being called here
smileyFace();
}