If have a line that is shot from my guy. The angle, distance
and start and end points are known. I have again, a 30x30 grid. Is
it possible to find out which grid spaces the line crosses? E.g. a
line from 0,0 to 0,90 will cross grid spaces 0,0 0,1 0,2. Its
obviously easy in this example just Math.floor() the numbers but
when it is at an angle is gets much more complexe.
Thanks for any help I get!
I know the feeling...
Well, that's a simple trick. In the attached code have a look
at the function getTempPositions()
If you want to test the code, it will need an mc with linkage
name cell (to build the grid) a movieclip with instance name grid
(in which the grid is build) and a circle mc with instance name
point_clip1 on the stage.