I'd create an array of vectors that represent the 'walls'* and then check for collisions with a lines_intersect function (see code archives), i.e. check each wall vector for a collision with the ball trajectory/movement vector.
Once you've found a collision, you can calc the normal of the wall vector (or have them pre-calced) and calculate your reflection vector from there.
Can't give any code as I don't have bmax. :P
* you could knock up a quick editor to make setting these vectors easy.
Once you've found a collision, you can calc the normal of the wall vector (or have them pre-calced) and calculate your reflection vector from there.
Can't give any code as I don't have bmax. :P
* you could knock up a quick editor to make setting these vectors easy.