Example 1: Shapes + Motion
Code
let t = 0;
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(250, 244, 248);
fill(255, 50, 140);
ellipse(200 + sin(t) * 120, 200, 70, 70);
fill(25, 25, 35);
rect(120, 290 + sin(t * 2) * 18, 160, 24, 12);
fill(20);
textAlign(CENTER);
text('p5.js workshops', 200, 40);
t += 0.03;
}Try this: Change speed and color values to create your own rhythm.