I've made a mini-tutorial on BMax angles

Miscellaneous Forums/General Discussion/I've made a mini-tutorial on BMax angles

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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:

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