Skip to content

Instantly share code, notes, and snippets.

@hilukasz
Created June 26, 2014 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hilukasz/8fd3200f5da1d27af14e to your computer and use it in GitHub Desktop.
Save hilukasz/8fd3200f5da1d27af14e to your computer and use it in GitHub Desktop.
float x;
float easing = 0.05;
float targetX = origin;
float dx = targetX - x;
if(abs(dx) > 1) {
x += dx * easing;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment