actionscript 3 - selecting a cell in a grid, spiral outwards through neighbour cells? -
i accomplish 2 things this:
select (any) cell grid, , give 'bands' of neighboring cells ever increasing value (in example 1 -5)
from selected cell, select next cell in spiral fashion show in blue, accounting if 'route' leave grid.
how go this?
from picture, don't have in spiral. picture shows, say, concentric circles (or, rather, squares).
you can calculate next concentric square subtracting or adding 1 left/top or right/bottom edge coordinate correspondingly.
Comments
Post a Comment