Skip to content

MapPlayer beta ​

Interface of @v12-engine/engine

ts
export interface MapPlayer

A seat for a player of the map: the player's id, name, team and colour with the options for what they start with

Members ​

camera ​

ts
camera?: string;

Where their view starts, by the name of a camera of the map (MapCamera). Over their start when it has one

color ​

ts
color: [number, number, number];

The player's colour as red, green and blue in 0..1

controller ​

ts
controller?: 'person' | 'computer' | 'nobody';

Who plays them: a person, the computer, or nobody (an open slot left empty). The game's to say when left out: the game reads it (world.map.player(id)), the engine does nothing with it

data ​

ts
data?: Record<string, unknown>;

What the game's own fields for players were set to (defineMapField with for: 'player')

id ​

ts
id: PlayerId;

The player's id, the number units and entities are owned by

name ​

ts
name: string;

The player's name as lobbies show it

race ​

ts
race?: string;

The race they play, fixed by the map (a campaign's), of the game's races (Rules.races), or random: not chosen in a lobby. Left to the lobby, or the game's first, when left out

resources ​

ts
resources?: Record<string, number>;

What they start with, by resource id, over what the game gives everyone

start ​

ts
start?: Vec2;

Where their base goes, for a game that gives everyone a start

team ​

ts
team: number;

The player's team number; players of the same number are allies