![]() |
sorting for lowest array values
so, what I want to do is detect the closest baddy to an npcs x and y location. here is what I have so far .. how can i sort the 2 arrays better?
PHP Code:
|
You could do the distance calculation while scanning through the baddies:
PHP Code:
|
thanks! that works quite nicely
|
findareanpcs(float, float, float, float) - returns object - returns an array of all npcs at the specified rectangle (x,y,width,height)
|
| All times are GMT +2. The time now is 06:29 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.