xxxxxxxxxx
25
var x = [];
var y = [];
function setup() {
createCanvas(800, 800);
}
function draw() {
//background(220);
if (mouseIsPressed) {
x.push(mouseX);
y.push(mouseY);
}
for (var i=0; i < x.length; i=i+1) {
ellipse(x[i], y[i], 40, 40);
var dx = mouseX-x[i];
var dy = mouseY-y[i];
x[i] = x[i] + dx/100;
y[i] = y[i] + dy/100;
}
}