GameRunOptions beta
Interface of @v12-engine/client
export interface GameRunOptionsA 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
back?: {
label: string;
run: () => void;
};The error screen's way out of the game. The HUD's (leave) when left out
errorPolicy
errorPolicy?: ErrorPolicy;What a game played in the page comes to when its rules throw (GameClientOptions.errorPolicy)
keepsMusic
keepsMusic?: boolean;The music playing goes on, and the game starts none (GameClientOptions.keepsMusic)
leave
leave?: {
label: string;
run: () => void;
};The HUD's way out of the game, and its pause menu's. None without
load
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
name: string;What the game is called: on its loading screen, its error screen, its pause menu, the debug panel
onCrash
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
onError?: (error: unknown) => void;Told when the game could not be loaded, and when it stopped after
onLoaded
onLoaded?: (client: GameClient) => void;Told the client once the game is on
replays
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
restart(from?: WorldSave): void;The same game again, as it was opened: from the start, or from a save (a checkpoint)
saves
saves?: SaveControls;Saving and loading from the HUD (SaveControls). Neither without
warm
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)