Index / 2017 / Easing
400×400 · p5.js instance mode
Easing.pde 25 lines
float x;
float y;
float easing = 0.05;

//Easing

void setup() {
  size(400, 400);
  smooth();
  frameRate(120);
  rectMode(CENTER);
}

void draw() {
  background(#);
  strokeWeight(10);
  stroke(#);
  fill(#C5CAE9);

  float targetX = mouseX;
  x += (targetX - x) * easing;
  float targetY = mouseY;
  y += (targetY - y) * easing;
  ellipse(x, y, width/5, height/5);
}
read-only archive source from /2017/Useful References/Easing/Easing.pde

Description

This page is generated from the Processing project folder at /2017/Useful References/Easing/Easing.pde.

Archive

No companion assets were found in this sketch folder.