Skip to content

Core functionalities for running MoroboxAI games on various platforms

License

Notifications You must be signed in to change notification settings

moroboxai/moroboxai-player-sdk

Repository files navigation

moroboxai-player-sdk

NPM version Node.js CI gitHub license Code Quality: Javascript Total Alerts

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:

Install

Using npm:

npm install moroboxai-player-sdk --save

Implementation

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);

License

This content is released under the MIT License.