Skip to content

PrefabDef beta ​

Interface of @v12-engine/engine

ts
export interface PrefabDef

A prefab of a game's own: what world.spawnPrefab puts down as one. Its contents as data, or made for the place and the world (a camp the stronger the farther from the starts)

Members ​

contents ​

ts
contents: PrefabContents | ((at: Vec2, world: World) => PrefabContents);

What the prefab is made of: plain data, or a function of the spawn point and the world that returns it

id ​

ts
id: string;

Shared by every game: give it a prefix of the game's ('td.fortress')

name ​

ts
name?: string;

A readable name for the prefab, for tools that list prefabs