double heuristic(Tile tile, Tile goal) { final x = tile.x - goal.x; final y = tile.y - goal.y; return math.sqrt(x * x + y * y); }