Skip to content

GameRunOptions beta ​

Interface of @v12-engine/client

ts
export interface GameRunOptions

A game run on a page (runGame), from loading it to taking it away: what launch, a scene of a game and the editor's Play here each say of theirs. What draws it (GameMount) is told nothing else

Members ​

back ​

ts
back?: {
        label: string;
        run: () => void;
    };

The error screen's way out of the game. The HUD's (leave) when left out

errorPolicy ​

ts
errorPolicy?: ErrorPolicy;

What a game played in the page comes to when its rules throw (GameClientOptions.errorPolicy)

keepsMusic ​

ts
keepsMusic?: boolean;

The music playing goes on, and the game starts none (GameClientOptions.keepsMusic)

leave ​

ts
leave?: {
        label: string;
        run: () => void;
    };

The HUD's way out of the game, and its pause menu's. None without

load ​

ts
load(context: GameRunContext): Promise<GameClient>;

Makes the game's client where the run says (GameRunContext): prepareGame and assembleClient, most of the time. The client is the run's from then on: loaded, started, and disposed when the run is

name ​

ts
name: string;

What the game is called: on its loading screen, its error screen, its pause menu, the debug panel

onCrash ​

ts
onCrash?: (report: CrashReport) => void;

Told the same, with what is known of it and the last things said: for a crash report of the game's own. The library sends it nowhere

onError ​

ts
onError?: (error: unknown) => void;

Told when the game could not be loaded, and when it stopped after

onLoaded ​

ts
onLoaded?: (client: GameClient) => void;

Told the client once the game is on

replays ​

ts
replays?: {
        keep: (replay: Replay) => void;
        checkpoints?: number;
    };

A game played in the page is recorded (recordGame, with checkpoints every so many ticks), and its replay handed to keep once it ends, when it lasted more than a few seconds. Not recorded without

restart ​

ts
restart(from?: WorldSave): void;

The same game again, as it was opened: from the start, or from a save (a checkpoint)

saves ​

ts
saves?: SaveControls;

Saving and loading from the HUD (SaveControls). Neither without

warm ​

ts
warm?: false | WarmLook;

The warm-up behind the loading screen for this run (client.prepare): false for none, or what (WarmLook) over the map's and the game's (GameView.world.warm)