Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. float x;
  2. float y;
  3. float easing = 0.05;
  4.  
  5. void setup() {
  6. size(640, 360);
  7. noStroke();
  8. }
  9.  
  10. void draw() {
  11. background(51);
  12.  
  13. float targetX = mouseX;
  14. float dx = targetX - x;
  15. x += dx * easing;
  16.  
  17. float targetY = mouseY;
  18. float dy = targetY - y;
  19. y += dy * easing;
  20.  
  21. ellipse(x, y, 66, 66);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement