kts.RemoveTile – remove a tile from the dungeon
kts.RemoveTile(pos, tile)
Given a Position (table containing x
and y
co-ordinates) and a Tile, this function will look for a copy of the given tile in the given dungeon square, and if found, remove/delete it.
If multiple copies of the tile exist in the given square, only one is removed.
No value is returned.
An error occurs if the input arguments are not a valid map position or Tile respectively.
If no copy of the tile exists at the given square, this is not an error – the function just does nothing in that case.
One example of using this function is to implement "toggling" between, say, an open pit tile and a closed pit tile. kts.RemoveTile
would be used to remove the open pit and kts.AddTile
would be used to replace it with a closed pit (or vice versa).