Chesso
04-06-2013, 12:26 AM
I know a way it could be done (looping and checking against X, Y positions and finally narrowing it down) but looking to see if there are better or cleaner looking methods.
I have a defense mechanism with a certain range (let's say a 75 pixel radius), and I want it to react to enemies that come within that range, but I want the reaction to be biased
(the closest one to the mechanism for example), so it follows it until something else comes into a closer range.
It's probably not the nicest method but all my elements are array records (defenses, enemies etc), so I track all their data.
I have a defense mechanism with a certain range (let's say a 75 pixel radius), and I want it to react to enemies that come within that range, but I want the reaction to be biased
(the closest one to the mechanism for example), so it follows it until something else comes into a closer range.
It's probably not the nicest method but all my elements are array records (defenses, enemies etc), so I track all their data.