// The pos property is an object with x and y properties.
// pos.x is a number representing the horizontal position on the map
// pos.y is a number representing the vertical position on the map
while(true) {
var enemy = hero.findNearestEnemy();
if(enemy) {