namespace
Map
A character grid the game paints and reads.
Map.size(width, height)Set the tilemap dimensions in cells before filling rows.Map.row(y, cells)Fill one row of the tilemap from a string of tile characters.Map.tile(x, y) -> intRead the tile character at a cell (out-of-bounds reads answer '#').Map.get(x: tx, y: ty) -> intThe glyph at a cell ('#' outside the map).Map.set(x: tx, y: ty, glyph: g)Write one cell in place.Map.fill(glyph: g)Every cell becomes the glyph.Map.rect(x: tx, y: ty, width: w, height: h, glyph: g)Fill a rectangle of cells.Map.border(glyph: g)The outermost ring of cells.Map.random_cell(glyph: g) -> IVec2A random cell holding the glyph (seeded RNG).Map.is_solid(x: tx, y: ty) -> boolIs a cell solid, per the Solids config?Map.is_solid_at(x: px, y: py) -> boolIs the cell under a pixel position solid?Map.width() -> intThe map's width in cells.Map.height() -> intThe map's height in cells.Map.random_cell_far(glyph:, from:, min_tiles:) -> IVec2A random cell with the glyph, at least a distance from a point.Map.to_tile(pixel: IVec2) -> IVec2The tile under a pixel position.