@sirbots
Check out this example program:
play.creaticode.com/projects/67a3c43978886c154e0b60af
Note that its code is written by our AI assistant XO, when it is given the following request:
I have 2 lists of x and y positions of targets, and I need to search among them to find which one is closest to this sprite. Use 2D distance.
For this kind of small coding questions, we strongly recommend you to ask XO to get started. All you need is to clearly describe your needs.
If you are new to working with XO, you can try to use the “TIRE” method for prompting it: https://www.forum.creaticode.com/topic/1785/ai-the-t-i-r-e-prompting-method-difficulty-3