xxxxxxxxxx
25
var px = 0;
var py = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
if (mouseIsPressed){
background("DodgerBlue");
} else {
background(30, 144, 255, 20);
}
var A = 0.90; // The weight of history
var B = 1.0-A;
px = A*px + B*mouseX;
py = A*py + B*mouseY;
noStroke();
fill("white");
circle (px, py, 40);
}