write an attentuation function and use it for ball friction