I’ve used it a few times and it works well enough at stopping things, but how does it actually work? is it a flat deceleration? is it proportional? is it exponential? how does it work?
2 Likes

1 Like
Here is the code for the X half of the equation. Basically it works as follows.
This code is essentially doing the same thing as the acceleration code, which is also in that screenshot. It’s as if you have a loop that applies acceleration in the direction opposite of the player’s movement direction. In fact, here’s a test where one sprite has friction 50, and the other has acceleration -50, and you can see they move the exact same until they reach 0 speed!
