No they work normally.
Friction should be a constant rather than a proportion of velocity.
I would calculate it by normalising the x and y speeds and multiplying that by the friction constant.
something like:
Friction should be a constant rather than a proportion of velocity.
I would calculate it by normalising the x and y speeds and multiplying that by the friction constant.
something like:
const friction#=0.1 ;This is your constant value for friction, you might want it to be a variable based on the surface ; xvel & yvel are the current velocity of the ball speed#=sqr (xvel*xvel + yvel*yvel) frx#=(xvel/speed)*friction fry#=(yvel/speed)*friction ; frx,fry is a vector with the same direction as xvel,yvel but its length is the same as 'friction' ;subtract the friction vector from the movement vector xvel=xvel-frx yvel=yvel-fry