xxxxxxxxxx
29
// Uses https://www.npmjs.com/package/p5.createloop
// Be sure that the following script is included in index.html:
// https://unpkg.com/p5.createloop@0.2.8/dist/p5.createloop.js
function setup() {
createCanvas(640, 640);
frameRate(30);
pixelDensity(1);
createLoop({
duration: 3,
gif: false
});
animLoop.noiseFrequency(0.45);
}
//------------------------------------------
function draw() {
background("DodgerBlue");
fill("white");
noStroke();
var x = width/2 + map(cos(1 * animLoop.theta), -1, 1, -200,200);
var y = height/2 + map(sin(2 * animLoop.theta), -1, 1, -200,200);
circle (x, y, 120);
}