kts.RotateDirection

Name

kts.RotateDirection – transform a direction (north/east/south/west) to take into account dungeon rotation

Synopsis

result = kts.RotateDirection(position, direction)

Description

The dungeon generator can randomly rotate and/or reflect dungeon rooms in order to add variety. This means that what is "north" in the original map segment might be "east" (or another direction) in the actual game, depending on how the map generator decided to lay out the segments.

This function takes a position, and a direction (string "north", "east", "south" or "west") from the point of view of the original map segment, and returns the same direction as it is in the actual dungeon.

Return Value

A string "north", "east", "south" or "west" is returned.

Errors

Errors will occur if the inputs are not a valid position/direction.

Examples

This is used to ensure that the "skull" traps in the dungeon fire in the correct direction: see tile_funcs.lua.

See Also

kts.RotateAddPos