This question already has an answer here:
- Find Nearest Object 4 answers
Is there an algorithm that would calculate the location of the nearest MovieClip in an array? Perhaps a loop? If so, what?
This question already has an answer here:
Is there an algorithm that would calculate the location of the nearest MovieClip in an array? Perhaps a loop? If so, what? |
|||||||||||||||||
|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Something like the following algorithm:
If you find that this is slow, and it will be if you have a lot of items, you'll want to look into spatial partitioning and other methods for optimizing finding objects that are close. |
|||||||||
|