rowsOf(text: string) → void
| arg | type | description |
|---|
| text | string | |
parse(text: string) → void
Split room text into the text Level2D builds and the metroidvania pieces in it (room-local tile coordinates, y up from the bottom row). Returns levelText, pieces, width, height, grid.
| arg | type | description |
|---|
| text | string | |
solidAt(grid: { { string } }, r: number, c: number) → boolean
| arg | type | description |
|---|
| grid | { { string } } | |
| r | number | |
| c | number | |
exits(id: string, grid: { { string } }, w: number, h: number, gx: number, gy: number) → void
Find a room's exits: runs of open cells along its border (gates count as open).
| arg | type | description |
|---|
| id | string | |
| grid | { { string } } | |
| w | number | |
| h | number | |
| gx | number | |
| gy | number | |
scan(side: string, len: number, isOpen: (number) → void
| arg | type | description |
|---|
| side | string | |
| len | number | |
| isOpen | (number | |
register(room: Room) → void
Add (or replace) a room in this peer's registry. The Room component calls it.
| arg | type | description |
|---|
| room | Room | |
unregister(id: string) → void
| arg | type | description |
|---|
| id | string | |
get(id: string) → Room
A room by id.
| arg | type | description |
|---|
| id | string | |
all( ) → void
Every room on this peer, in the order they were built.
at(x: number, y: number) → Room
The room containing a world point, or nil.
| arg | type | description |
|---|
| x | number | |
| y | number | |
atCell(cx: number, cy: number) → Room
The room covering grid cell (cx, cy), or nil.
| arg | type | description |
|---|
| cx | number | |
| cy | number | |
across(exit: Exit) → Room
The room an exit leads into, or nil when nothing is built there.
| arg | type | description |
|---|
| exit | Exit | |
pieceRect(room: Room, p: Piece) → void
World-space rectangle of a piece of a room: x0, y0, x1, y1.
| arg | type | description |
|---|
| room | Room | |
| p | Piece | |
seal(link: string, on: boolean) → void
Seal (or open) every boss door linked to `link` for this peer's player.
| arg | type | description |
|---|
| link | string | |
| on | boolean | |
isSealed(link: string) → boolean
Are the boss doors linked to `link` sealed for this peer's player?
| arg | type | description |
|---|
| link | string | |
setSealStyle(link: string, style: string?) → void
Set how the doors of arena `link` seal: portcullis, thorns, energy, rubble, runes, door (the boss door's own slab) or theme. The BossArena component sets it.
| arg | type | description |
|---|
| link | string | |
| style | string? | |
sealStyle(link: string) → string
The seal style arena `link` asked for ("theme" when none was set).
| arg | type | description |
|---|
| link | string | |
⌬ Types
Exit = {Piece = { kind: string, x: number, y: number, w: number, h: number, index: number }Room = {