+
+ if (click[0]) {
+ let hx = map.tileX(hero.position[0], hero.position[1]);
+ let hy = map.tileY(hero.position[0], hero.position[1]);
+ let cx = map.tileX(click[0], click[1]);
+ let cy = map.tileY(click[0], click[1]);
+ if ( (cx == hx - 1 || cx == hx + 1 || cx == hx)
+ && (cy == hy - 1 || cy == hy + 1 || cy == hy))
+ events(click[0], click[1]);
+ click = [];
+ }