xxxxxxxxxx
27
/**
* This is a sample code for "p5-inst" library.
* See also how it's loaded in "index.html".
*/
const { createSketch } = p5i;
const setup = (p) => {
p.createCanvas(400, 400);
p.noFill();
p.stroke(32);
p.strokeWeight(8);
};
const draw = (p) => {
p.background(240);
p.circle(200, 200, 240 + 80 * Math.sin(0.1 * p.frameCount));
};
const sketch = createSketch({
setup,
draw,
// you may include other methods as well, e.g. mousePressed()
});
new p5(sketch);