Host typegenerated
Grid
Grids of tiles, flat or stacked in layers like building blocks: what each cell holds, where objects stand on them, and paths across them.
19 members · engine 0.1.0
Grid.block(grid: Entity, column: number, row: number, level: number) -> StringWhich block is in a cell of a layered grid or a grid whose ground is a voxel world, by name, or""if the cell is empty.Grid.can_reach(mover: Entity, grid: Entity, target: Entity) -> boolWhether a character on a grid can walk to where another object is.Grid.columns(grid: Entity) -> numberHow many columns a grid has.Grid.flooded(map: Entity, column: number, row: number) -> boolWhether a map column's existing surface is strictly below its flood level. Reads the same threshold the map draws; terrain and edits stay unchanged.Grid.height(grid: Entity, column: number, row: number) -> number?How high the top of a voxel world's column is, asGrid.surfacesees it, ornullwhere nothing stands.Grid.place(entity: Entity, grid: Entity, x: number, y: number) -> unitMoves an object to a position on a grid, measured in cells. Fractions place it between cells.Grid.position_x(entity: Entity, grid: Entity) -> numberWhich column an object is at on a grid, with fractions between cells.Grid.position_y(entity: Entity, grid: Entity) -> numberWhich row an object is at on a grid, with fractions between cells.Grid.rows(grid: Entity) -> numberHow many rows a grid has.Grid.set_block(grid: Entity, column: number, row: number, level: number, tile: String) -> unitPlaces a block, by name, in a cell of a layered grid or a grid whose ground is a voxel world.""removes the block.Grid.set_flood(map: Entity, level: number, block: String) -> unitSets a reversible water overlay on a voxel world viewed as a map, using a finite height and a block's top face. An empty block name clears it. Refused on block views.Grid.set_terrain(grid: Entity, column: number, row: number, terrain: String) -> unitPaints a terrain the map's sheet declares into a flat tile map's cell, choosing its tile and its neighbors' from which of them are the same terrain.""empties the cell and redraws its neighbors.Grid.set_terrain_corner(grid: Entity, column: number, row: number, terrain: String, set: bool) -> unitSets or clears one corner of acornersterrain on a flat tile map, and redraws the up to four tiles that meet there. A corner is named by the grid line crossing it, so a map of 3 by 2 tiles has corners 0 to 3 across and 0 to 2 down.setistrueto make the corner the terrain,falseto give it back to the ground.Grid.set_tile(grid: Entity, column: number, row: number, index: number) -> unitChanges a flat tile map's cell to one of its tiles, by number. A negative number empties the cell.Grid.step_toward(mover: Entity, grid: Entity, target: Entity) -> boolMoves a character one cell along the shortest walkable path towards a target. Gives back whether it moved.Grid.surface(grid: Entity, column: number, row: number) -> StringWhich block is on top of a voxel world's column, by name, seen from straight above, or""where nothing stands. What a map view of the world draws there.Grid.tagged(grid: Entity, column: number, row: number, level: number, tag: String) -> boolWhether the block in a cell has a label, such as"hot"on lava, given to it where the blocks are defined.Grid.tile(grid: Entity, column: number, row: number) -> numberWhich tile is in a flat tile map's cell, by number, or -1 if it is empty or outside the map.Grid.walkable(grid: Entity, x: number, y: number) -> boolWhether a character could stand at a point on a grid. False for water, empty space or outside the grid.
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b