This package provides the core functionalities for running MoroboxAI games on various platforms, but lacks the gutter that is required for some platform-specific functionalities.
See:
- moroboxai: for running games on the desktop with Electron
- moroboxai-player-web: for embedding games on the web
- moroboxai-player-react: for embedding games in React apps
Using npm:
npm install moroboxai-player-sdk --save
This package is meant to be extended by implementing the missing gutter for the desired platform:
import * as MoroboxAIPlayerSDK from 'moroboxai-player-sdk';
// The gutter added by our implementation
const sdkConfig: MoroboxAIPlayerSDK.ISDKConfig = {
// Define how we create a file server on this platform
fileServer: (baseUrl: string) => ...,
// Define how we create a zip server on this platform
zipServer: (baseUrl: string) => ...
};
// Retrieve the HTMLElement we want to attach the player to
const element: Element = ...;
// The generic options for the player
const options: MoroboxAIPlayerSDK.IPlayerOptions = ...;
// Entrypoint of moroboxai-player-sdk with our gutter
MoroboxAIPlayerSDK.init(sdkConfig, element, options);
This content is released under the MIT License.