Moving objects based on closeness ?
beaudoin_n
Member Posts: 184
Hi,
I'd like to have let's say a 5X5 grid of objetcs, then chose a position at random in there (1-25) then be able to switch that position with one that is close (left, right, up or down) so if the grid is like this
01-02-03-04-05
06-07-08-09-10
11-12-13-14-15
16-17-18-19-20
21-22-23-24-25
13 would be able to switch with either 08-12-14-18
19 would be 14-18-20-24
and so on.. if there is not object then it would just no switch with those positions.. so lie 25 can only move with 20 and 24.
Any idea on how to achieve this ?
How about dynamically?
Thanks
I'd like to have let's say a 5X5 grid of objetcs, then chose a position at random in there (1-25) then be able to switch that position with one that is close (left, right, up or down) so if the grid is like this
01-02-03-04-05
06-07-08-09-10
11-12-13-14-15
16-17-18-19-20
21-22-23-24-25
13 would be able to switch with either 08-12-14-18
19 would be 14-18-20-24
and so on.. if there is not object then it would just no switch with those positions.. so lie 25 can only move with 20 and 24.
Any idea on how to achieve this ?
How about dynamically?
Thanks