Set Exit
map.setExit(roomId, destRoomId, dir, createReverse = true)
Creates or updates an exit from room roomId
to room destRoomId
using the specified direction. If the exit already exists, it is updated.
Param | Type | Description |
---|---|---|
roomId | number | ID of the exit source room |
destRoomId | number | ID of the exit destination room |
dir | string | Direction (full or abbreviated) |
createReverse | boolean | (Optional) When true, will create an exit in reverse from dest to source. |
Example
js
const roomId = 1029;
const label = "pub";
// create north exit from 100 to 110
// and a south exit from 110 to 100
map.setExit(100, 110, "north");