Skip to content

GameClientOptions beta ​

Interface of @v12-engine/client

ts
export interface GameClientOptions

What a game's client is made with: the canvas, the player's session and the rest of what it draws and plays through. The renderer is made on the canvas as the client is (createLiteClient)

Members ​

antialias ​

ts
antialias?: boolean;

Whether the picture is drawn with anti-aliasing: as the settings say when left out

assets ​

ts
assets?: {
        base?: string;
    } | Assets;

Where the game's files are: the address the shared folders and the game's own (GameView.files.assets) are under, the app's base when left out (/, or what it is deployed under); or the Assets to find them with, made by the game

canvas ​

ts
canvas: HTMLCanvasElement;

The canvas the client draws the game on

debug ​

ts
debug?: LocalSession | boolean;

Direct access to the simulation, for the debug tools. Only there when the game runs in the page itself: nothing the player needs may depend on it. true for the session itself, when it is one played in the page: no need to hand the same session over twice

errorPolicy ​

ts
errorPolicy?: ErrorPolicy;

What a game played in the page comes to when its rules throw, where its rules say nothing (Rules.onError): 'end' ends it there, and the player is told (Failure). The world's own (it throws) when left out

keepsMusic ​

ts
keepsMusic?: boolean;

The music playing goes on, and this game starts none: a game behind a menu that has music of its own (MenuDef.music)

log ​

ts
log?: Logger;

The logger the client's own is made under (client.log): the page's, a tool's. The client's shared one when left out

lookAt ​

ts
lookAt?: Vec2;

Where the camera starts

mixer ​

ts
mixer?: AppMixer;

The app's sound, which this game's attaches to: the runtime's (ClientRuntime.mixer) in an app, one of its own elsewhere

overlay ​

ts
overlay: HTMLCanvasElement;

2D canvas stacked on top of the main one

pack ​

ts
pack?: MapPack;

The files the map brings with it, looked up before the game's (see MapPack)

qualityKept ​

ts
qualityKept?: boolean;

Whether the player kept a quality before (QualityParts.kept)

qualityStart ​

ts
qualityStart?: QualityPreset;

The quality preset to start at where nothing was set (see QualityParts.start)

reconnect ​

ts
reconnect?: Reconnect;

How a dropped connection to a server is got back (client.connection): what made the session says, the lobby (LobbyController.reconnect). A drop is lost at once without

root ​

ts
root?: HTMLElement;

The game's element on the page, with the canvas and the HUD in it: its theme is put on it, and keys pressed with the focus elsewhere of the page are not the game's. The canvas's parent when left out

runtime ​

ts
runtime?: ClientRuntime;

What the app runs with (ClientRuntime): where it keeps things in the browser. The page's when left out

saves ​

ts
saves?: SaveControls;

Saving and loading where the game is played (SaveControls): the client's saves are made of it (client.saves). None without

session ​

ts
session: GameSession;

The player's seat in the game. Everything the client knows and does goes through it

settingsStore ​

ts
settingsStore?: SettingsStore;

Where what the player sets is kept: the browser's when left out (SettingsStore)

startView ​

ts
startView?: string;

Where the camera starts, by the name of a view of the map (MapCamera): over lookAt when the map has it

view ​

ts
view: GameView;

How the game looks and sounds: the client side of the game module