Quote:
|
Originally Posted by napo_p2p
I don't believe it returns an array of indexes, but rather an array of 'players' (objects). From my experience with it, it returns an array of all the players in the level, arranged from closest to farthest.
|
oh right, yea, it does return an array of objects :P
If that's the case, to maximize efficiency on a rectangular field, you'd want to break the checking loop when you encounter the first instance where the player's distance from the center of the field is greater than the distance from the center of the field to the corner of the field.
I'm working on a new damage system for Classic, and although it's working 100x better than the current one, I'd still like to optimize it as much as possible. I was actually wondering if I'd have to distribute the damage field into checking different spots, but after what you tell me, I could actually decrease lag. Of course, most efficient if you use squares or circles.