xxxxxxxxxx
22
//Be sure to add the gsap file to your index!
//see also - https://createjs.com/tweenjs maybe?
/*
Most basic use of GSAP to function to ease a sketch variable
*/
var x=0, y=200;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(32);
stroke(255, 0, 0);
ellipse(x, y, 50, 50);
}
function mousePressed() {
gsap.to(this, {x:200, y:"+=50"});
}