Triangle ease in P5js
var x = 10;
var y = 0;
var px = 10;
var py = 0;
var easing = 0.01;
function setup(){
createCanvas(600, 600);
background(0);
}
function draw() {
var targetX = mouseX;
x += (targetX - x) * easing;
var targetY = mouseY;
y += (targetY - y) * easing;
py = y;
px = x;
fill(255);
strokeWeight(1);
stroke(0);
triangle(x, y-100, x+100, y+100, x-100, y+100);
}
function mousePressed() {
clear();
}