What world:nearest gives
world:nearest gives a table with these in it, or nil when nothing is near enough. (Here it is called found.)
found.thingfunction
found.thing: thing or nilThe nearest thing (nil when water was asked for: water is no thing).
found.distancefunction
found.distance: numberHow far it is from the place, in tiles (0: the place is inside it).
found.xfunction
found.x: numberThe place of the thing that is nearest, from left to right.
found.yfunction
found.y: numberThe place of the thing that is nearest, from top to bottom.