xxxxxxxxxx
30
var x, y, easing, prevX, nextX;
var xPos = [1];
function setup() {
createCanvas(400, 400);
easing = 0.05;
y = 50;
x = 50;
}
function draw() {
background(220);
nextX = xPos[xPos.length - 1];
x = lerp(x, nextX, easing);
circle(x, y, 50, 50);
}
function mousePressed() {
xPos.push(xPos[xPos.length - 1] + 100);
//console.log(xPos);
}