Luawe All pages

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 nil

The nearest thing (nil when water was asked for: water is no thing).

found.distancefunction

found.distance: number

How far it is from the place, in tiles (0: the place is inside it).

found.xfunction

found.x: number

The place of the thing that is nearest, from left to right.

found.yfunction

found.y: number

The place of the thing that is nearest, from top to bottom.