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

# Is there anyway to find the nearest x, y coordinates

**AdrianCgw**#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())

**BarnZarn**#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?