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?

enter image description here

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

Popular posts from this blog

razor - Is this a bug in WebMatrix PageData? -

c# - How to set Z index when using WPF DrawingContext? -

visual c++ - Using relative values in array sorting ( asm ) -