Initialize platform (Cordova, NW.js) and file system
[heading: "Description"]A conditional startup state that runs before any external storage is accessed. When the game is running inside a Cordova environment the Cordova script is injected and the filesystem is created once the device is ready; on NW.js it creates the required directory structure; on other platforms it builds the folder structure immediately.
[heading: "Methods"] [table header] [ Method | Parameters | Description ] [ create | () | Detects the current environment: on Cordova it injects cordova.js and waits for the device to be ready, otherwise it builds the folder structure immediately. ] [ loadScript | () | Shows the loading dots, injects the cordova.js script into the page, and registers a back button handler for mobile devices once the Cordova device is ready. ] [ createFolderStructure | () | Creates the main storage directory along with its addons, screenshots, songs, and editor output subdirectories, then continues to the next startup state. ] [ checkFfmpegBundle | () | Check if the bundled ffmpeg lib needs to be copied to external folder and copies them ] [ continue | () | Advances to the LoadAddons state to continue the startup sequence. ] [/table] [heading: "Example Usage (Modding)"] [codeblock javascript] // Added to the boot chain so storage directories exist before song loading. game.state.add('LoadPlatform', LoadPlatform); game.state.start('LoadPlatform'); [/codeblock] [footer: "© Retora 2026"]