Advertisement
xeromino

easing

Jan 12th, 2017
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var t, t1, t2;
  2. var frms = 200;
  3. var x = 0,
  4.   x2 = 0,
  5.   x3 = 0,
  6.   w = 0;
  7.  
  8. function setup() {
  9.   createCanvas(800, 600);
  10. }
  11.  
  12. function draw() {
  13.   background(255);
  14.   t = (frameCount % frms) / (frms - 1);
  15.   if (t < 0.5) {
  16.     w = width;
  17.   } else {
  18.     w = 0;
  19.   }
  20.   var N = 2;
  21.   x = ((x * (N - 1)) + w) / N
  22.   ellipse(x, 100, 50, 50);
  23.   N = 8;
  24.   x2 = ((x2 * (N - 1)) + w) / N
  25.   ellipse(x2, 150, 50, 50);
  26.   N = 20;
  27.   x3 = ((x3 * (N - 1)) + w) / N
  28.   ellipse(x3, 200, 50, 50);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement