Main class of Cosmos Journeyer. It handles the underlying BabylonJS engine, and the communication between the starmap view and the star system view. It also provides utility methods to take screenshots and record videos. It also handles the pause menu.

Properties

engine: AbstractEngine
mainMenu: MainMenu
musicConductor: MusicConductor
pauseMenu: PauseMenu
player: Player
sidePanels: SidePanels
starMap: StarMap
starSystemDatabase: StarSystemDatabase
starSystemView: StarSystemView
tutorialLayer: TutorialLayer

Methods

  • Generate save file data and store it in the autosaves hashmap in local storage

    Returns void

  • Generates save file data and downloads it as a json file

    Returns void

  • Inits the current star system

    Parameters

    • skipMainMenu: boolean = false

    Returns Promise<void>

  • Loads a save file and apply it. This will generate the requested star system and position the player at the requested position around the requested orbital object. This will perform engine initialization if the engine is not initialized.

    Parameters

    Returns Promise<void>

  • Loads universe coordinates and apply them. This will generate the requested star system and position the player at the requested position around the requested orbital object. This will perform engine initialization if the engine is not initialized.

    Parameters

    Returns Promise<void>

  • Parameters

    • isEnabled: boolean

    Returns void

  • Takes a screenshot of the current scene. By default, the screenshot is taken at a 4x the resolution of the canvas

    Returns void