AppScenesOptions beta
Interface of @v12-engine/client/app
export interface AppScenesOptionsWhat appScenes makes the scenes from
Members
credits
credits?: Pick<CreditsSceneOptions, 'title' | 'sections' | 'music' | 'speed'>;The credits (creditsScene): who made the game, by parts, and a track under them. No Credits without
debug
debug?: boolean;The debug panel in the game (🐞 on the top bar, Alt+Shift+D) and its cheats: on while the app is being developed (its runtime's dev) when left out, and the start screen's server lines with it
editor
editor?: (scene: AppEditorScene) => Scene | Promise<Scene>;The map editor as a scene (Map editor on the start screen, /?editor), made by what is given: the editor's editorScene (@v12-engine/editor) for one that opens on the first map, with Play here into the game's scene, or a function that sets it up as the game wants ((scene) => editorScene({ ...scene, extensions })), or that fetches the editor's package as it opens and gives back its editorScene (a promise: the start screen then carries none of the editor). Asked as the scene first opens. The page imports @v12-engine/editor/styles.css beside it. None when left out: the page has none of the editor's code
extra
extra?: readonly Scene[];Scenes of the project's own, in the list after the ones above (the campaign's menu and its missions). Their buttons are home.buttons
game
game: Game<unknown> | LoadedGame;The game (createGame): its rules say what the start screen shows (its name, its units, whether it makes random maps), and its view (Game.view(() => import('./view'))), with the client that draws it, is fetched as a scene first plays it, so that the start screen shows at once. Its maps and its start are the scenes' where maps and onStart are left out. Or one loaded already (LoadedGame), with its maps said
generatorWorker
generatorWorker?: RandomMapSceneOptions['generatorWorker'];What makes the worker the random map's preview is made in (RandomMapSceneOptions.generatorWorker): the starters' generate.worker.ts. This thread when left out
home
home?: {
buttons?: MenuScene['buttons'];
after?: MenuScene['buttons'];
behind?: MenuScene['behind'];
component?: MenuScene['component'];
};The start screen as a project wants it, declared here and not patched on the list after (home.buttons.unshift): buttons come first, before the ones the scenes give (the campaign's menu), after last (Exit); behind is the game played under the buttons (MenuDef.behind), component the screen drawn in place of the client's (MenuDef.component)
ids
ids?: Partial<Record<'home' | 'play' | 'editor' | 'server' | 'settings' | 'random' | 'credits' | 'profile', string>>;Deprecated
scenes: { play: { id } } says it beside the name
The ids of the scenes, where a project wants others: home, play, editor, server, settings, random, credits, profile
map
map?: string | (() => GameMap | Promise<GameMap>);The map a game starts on: a name of maps, or what makes one. The first of maps when left out
maps
maps?: Readonly<Record<string, GameMap | (() => Promise<GameMap>)>>;The game's maps by name, in the place of the game's (Game.maps). The first is the one a game is on when nothing says which. Each is the map, or what gives it (mapsFrom of a lazy glob): a map given so is fetched and read as a scene opens on it, and not as the page loads
menu
menu?: Partial<Pick<MenuScene, 'name' | 'title' | 'description' | 'details' | 'buttons' | 'background'>>;The start screen's own words: its title and description (the rules' name and "A game made with V12." when left out), lines added to what it says of the game (details), buttons added after the ones the scenes give
onStart
onStart?: GameSource['onStart'];What happens as a game starts, before anyone plays: computer players seated, a mission given. The game's (Game.onStart) when left out
profile
profile?: boolean;The player's profile of the game (profileScene): what they played and the achievements (GameView.achievements). None unless true
randomMap
randomMap?: boolean;A random map's scene (the rules' generator set as the player likes, played): when the rules have a generator, unless false
saves
saves?: GameScene['saves'];Whether the game (play) can be saved and loaded from its HUD, as GameScene.saves: {} for the client's defaults. No saving when left out
scenes
scenes?: Partial<Record<SceneKey, AppSceneChange>>;Each scene made, renamed or wrapped in place: its id (in place of ids), its name (the campaign's "Free play" for play), the label of its button on the start screen, and, for play, the loading its screen has (GameScene.loading). The name and the label are one thing said once: label is the name when left out
server
server?: boolean | {
url?: string;
rooms?: boolean;
};A server to play on: true for one game at a time on the machine the page came from (npm run server, port 8787; /?server=ws://host:port names another), { url } for a given one, { rooms: true } for a server of many games (Find a game, /?find-game)
settings
settings?: boolean;The settings scene: on unless false