Skip to content

patchCells beta ​

Function of @v12-engine/engine

ts
export declare function patchCells(terrain: Pick<Terrain, 'width' | 'depth' | 'cells'>, layer: string, cell: number, options?: PatchCellsOptions): number[];

The patch of a layer of cells one cell is in: the cells of the layer that touch it and each other, through sides and corners, as indices (z * width + x) in order. The patches of a hiding layer are these (concealmentPack); the editor's wand picks one. None where the cell is off the ground or 0

const field = patchCells(world.terrain, 'grass', cell, sameValue: true ) world.setCells('grass', field, 3)