xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
rectMode(CENTER);
}
function draw() {
// jump to the center of the sketch
translate(width/2, height/2);
// mapping of sin over time (-1 ... +1) to -200 ... 200
// speed is defined by /1000
let s = map(sin(millis()/500), -1, 1, -40, 40);
let c = map(cos(millis()/500), -1, 1, -30, 40);
noFill();
stroke(0);
background(255, 255, 255, 2);
translate(s,c);
rotate(millis()/500);
rect(0, 0, 200, 300);
rotate(PI / 3.0);
rect(750,300,600,300);
ellipse(550,300,700,400);
}