Skip to content

CellLayerDef beta ​

Interface of @v12-engine/engine

ts
export interface CellLayerDef

A layer of cells a game paints its maps with, for its rules to read: where the bushes are, what burns, where a lane runs. A value per cell (0 to 255, 0 being none), kept with the map (GameMap.cells), in the world's ground (Terrain.cells, read with terrain.cellAt), its saves and what each player is sent. The rules change it while the game runs with world.setCells: the players who see a cell are told at once, the others as it comes into their sight (TeamMemory.cells), so a change in the dark is not given away. The editor paints the layers a game lists (Rules.cellLayers), with the values it names

Members ​

color ​

ts
color?: [number, number, number];

The colour the editor shows it in, 0 to 1 each

description ​

ts
description?: string;

What it is for, for the editor's tooltip

id ​

ts
id: string;

Its key in Terrain.cells and in the map's file

name ​

ts
name: string;

What the editor calls it

speed ​

ts
speed?: number;

How fast one on foot goes over a cell of the layer that is not 0, as a multiplier of its speed: a swamp at 0.5. 1 when left out; a cell of several such layers is slowed by each (groundSpeedOfCell)

values ​

ts
values?: CellLayerValue[];

The values the editor paints with, named: [{ value: 1, name: 'Bush' }]. One value, 1, named after the layer when left out: a layer of cells that are or are not. Of a layer of grass or bushes, its styles (CellLayerValue.foliage)