Thread: Question
View Single Post
  #6  
Old 04-25-2011, 07:41 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Quote:
function getTarget() {
temp.bestTarget = null;
temp.bestValue = 0;

for (temp.pl: findnearestplayers(this.x, this.y)) {
temp.pIds = temp.pl.account;
}
//temp.pIds = getnearestplayers(this.x, this.y, player.hp > 0);

for (temp.pId: pIds) {
temp.pl = players[pId];

temp.dx = pl.x - this.x;
temp.dy = pl.y - this.y;
//temp.distance = abs(dx) + abs(dy); // manhattan distance
temp.distance = (dx * dx + dy * dy) ^ 0.5; // Euclidean distance
//pl.chat = distance @ " " @ dx @ " " @ dy;
// Ensure the following are true:
// within maximum distance, in front of us, and not behind a wall

if (distance > this.maxdist) {
continue;
}
Here is the part of the code im having issues with.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote