Skip to content

Commit f07dd01

Browse files
committed
Clean up README
1 parent 320b01a commit f07dd01

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,85 @@ local revdir = Mapper.revdir("ne")
2020
## The Map Object
2121

2222
***Map.new(name)***
23+
2324
Creates a new map (prefer to use `Mapper.create(name)`)
2425

2526
- Returns the `Map`
2627

2728
***Map:add_area(name)***
29+
2830
Adds a new area to the map and places 'you' inside the first room of that area.
2931

3032
- `name` The name of the area
3133
- Returns an `Area` or `nil` on conflicting names.
3234

3335
***Map:replace_area(name)***
36+
3437
Does the same as `Map:add_area` with reverse conditions
3538

3639
- `name` The name of the area
3740
- Returns an `Area` or `nil` if no name conflict was found.
3841

3942
***Map:track(dir)***
43+
4044
Moves your position on the map. This is what you would call in sync with your
4145
movement in the actual game world to keep the map tracking your position.
4246

4347
- `dir` The direction to track
4448
- Returns the `Exit` used or `nil` if directions isn't mapped.
4549

4650
***Map:go_back()***
51+
4752
Moves you back to the last room you were in. Good to use when tracking and
4853
accidentally walking into a closed door or non-existing exit.
4954

5055
- Returns the new current `Room`
5156

5257
***Map:set_position(id)***
58+
5359
Attempts to find a room in the map based on `id` and places you in that room.
5460

5561
- `id` A `Room` id
5662
- Returns a boolean representing success
5763

5864
***Map:find_room(id)***
65+
5966
Find a `Room` in the map based on `id`
6067

6168
- `id` A `Room` id
6269
- Returns `Room` and `Area.name` or nil
6370

6471
***Map:get_area()***
72+
6573
Returns your current `Area` or `nil`
6674

6775
***Map:get_room()***
76+
6877
Returns your current `Room` or `nil`
6978

7079
***Map:move(dir)***
80+
7181
Move your position on the map and create/link rooms as needed.
7282

7383
- `dir` The direction you are moving in
7484
- Returns the new `Room`
7585

7686
***Map:unmove()***
87+
7788
Undo the last move you did (deleting the room and resetting the exit).
7889
This is most useful when you accidentally walk into a closed door when
7990
mapping.
8091

8192
- Returns the new current `Room`
8293

8394
***Map:drop_last_exit()***
95+
8496
Deletes the last exit created in the current room. This can be used in
8597
conjunction with `Map:unmove()` when you accidentally created a non-existing
8698
exit.
8799

88100
***Map:save(path, [suffix])***
101+
89102
Saves the map to file. The filename is generated based on the map name.
90103

91104
- `path` The path to save to (eg. `/home/user/maps/`)

0 commit comments

Comments
 (0)