gameOptionsFromProjectfunctionnacatamalon
gameOptionsFromProject(settings: TProjectSettings) => TGameOptionsTurns a project's settings into what createGame takes.
The one place that translation happens, so that the day there is an editor with a play button and an exported build, both start the game down the same path and cannot drift apart.
mainScene is not part of it: which scene starts is createGame's second call, not an option.
For editors and other tools. A game written only in code does not need it: it passes its
options straight to createGame. This exists so a tool can save those options as a file and a
game made with that tool can read them back.
Parameters
settingsTProjectSettingsThe project's settings, from
parseProject.
Example
declare const scenes: Record<string, TSceneFn>;
const settings = parseProject(await (await fetch('/project.json')).json());
createGame('#app', gameOptionsFromProject(settings))(scenes, settings.mainScene || undefined);