Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/moroboxai/moroboxai-player-sdk

Core functionalities for running MoroboxAI games on various platforms
https://github.com/moroboxai/moroboxai-player-sdk

ai artificial-intelligence game javascript library moroboxai npm sandbox-playground sdk typescript

Last synced: about 2 months ago
JSON representation

Core functionalities for running MoroboxAI games on various platforms

Awesome Lists containing this project

README

        

# moroboxai-player-sdk

[![NPM version](https://img.shields.io/npm/v/moroboxai-player-sdk.svg)](https://www.npmjs.com/package/moroboxai-player-sdk)
![Node.js CI](https://github.com/moroboxai/moroboxai-player-sdk/workflows/Node.js%20CI/badge.svg)
[![gitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moroboxai/moroboxai-player-sdk/blob/master/LICENSE)
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/moroboxai/moroboxai-player-sdk.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-player-sdk/context:javascript)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/moroboxai/moroboxai-player-sdk.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moroboxai/moroboxai-player-sdk/alerts)

This package provides the core functionalities for running [MoroboxAI](https://github.com/moroboxai) games on various platforms, but lacks the gutter that is required for some platform-specific functionalities.

See:

- [moroboxai](https://github.com/moroboxai/moroboxai): for running games on the desktop with [Electron](https://www.electronjs.org/)
- [moroboxai-player-web](https://github.com/moroboxai/moroboxai-player-web): for embedding games on the web
- [moroboxai-player-react](https://github.com/moroboxai/moroboxai-player-react): for embedding games in [React](https://en.reactjs.org/) apps

## Install

Using npm:

```bash
npm install moroboxai-player-sdk --save
```

## Implementation

This package is meant to be extended by implementing the missing gutter for the desired platform:

```ts
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](http://opensource.org/licenses/MIT) License.