Is there anyway to find the nearest x, y coordinates


#1

In Sarven Treasure I cannot findnearest x, y coordinates. I need this help because i keep getting ambushed by ogre’s


#2

Not sure I understand your issue:
Your position is given by:
this.pos, with the x,y being this.pos.x and this.pos.x
An enemy’s position is enemy.pos
The nearest enemy is this.findNearestEnemy() or this.findNearest(this.findEnemies())


#3

I meant I cannot find the red x’s using x’y coordinates.
Thanks!


#4

see here: Sarven Treasure Teleporter Positions


#5

Thanks! I completed the level.


#6

I’m just uessing but i think you could use the pythagon theroum to mesure the distance or something like that and use a if starement to see if you should subtract or not. You get what im saying, right?


#7

Yeah, thanks for the idea.