Hm. Just a quick comment about reflecting off "easy angles"...
Suppose you're moving initially with slope y/x (to the top right in the following example):
CODE
Example
* }
o x } y = 1
o x }
oxxxxxxxxx }
~~~~~~~~~~
x = 3
(slope = 1/3)
If you now reflect off a horizontal surface, the new slope will be (-1)/3 - that is, y goes to -y.
If you reflect off a vertical surface, the new slope will be 1/(-3) - that is, x goes to -x.
If you reflect off a surface at 45 degrees (sloping up to the right):
CODE
*
ox
- (slope line should be 45deg)
-
o x- } y2 = 3
-
-
*-xx } x2 = 1 (new slope = 3/1)
o -
o -x
oxxxxxx-xx (original slope = 1/3)
-
-
The new slope is 3/1 - that is, x goes to y, and y goes to x.
Hopefully you can see that if the slope were at 135 degrees (sloping upwards to the left), the new slope would be (-3)/(-1) - that is, x goes to -y and y goes to -x.
Any other angle is really very tricky to reflect off.
[right][snapback]533230[/snapback][/right]
well, i did some work and found out that everytime a slope hits a vertical surface, it switches its X integer and the same goes for the Y integer when it hits a horizontal surface. i'm not sure if this was what you were trying to tell me or not. my system keeps track of the X and Y values independently, so 'difficult' slopes shouldn't be so difficult.