Skip to content

Instantly share code, notes, and snippets.

@fkaa
Created July 30, 2014 16:40
Show Gist options
  • Select an option

  • Save fkaa/67b4938f6a8b46f929fc to your computer and use it in GitHub Desktop.

Select an option

Save fkaa/67b4938f6a8b46f929fc to your computer and use it in GitHub Desktop.
if (velocity.x > 0) {
velocity.x -= fminf(velocity.x, kFriction);
} else {
velocity.x += fminf(fabs(velocity.x), kFriction);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment