Skip to content

MapThing beta ​

Interface of @v12-engine/engine

ts
export interface MapThing

A thing of a kind of a game's own on a map: something the game's editor puts down for its rules to read (a spawner, a waypoint, ground kept clear), where the engine's own kinds (objects, camps, regions, points, paths, doodads) do not say it. Kept with the map under the kind's name (GameMap.data[kind], a list of them), which the engine never looks inside: the rules read them (world.map.things(kind), mapThings)

Members ​

data ​

ts
data?: Record<string, unknown>;

The game's own fields of it, by their ids: what was set, without what is at its default

facing ​

ts
facing?: number;

The way it faces, in radians. 0 when left out

id ​

ts
id: number;

Its own among the things of its kind

name ​

ts
name?: string;

A name of its own, to find it by: no two things of a map have the same, whatever they are

x ​

ts
x: number;

Where the thing stands on the map's x axis, in cells

z ​

ts
z: number;

Where the thing stands on the map's z axis, in cells