axx-slide-game-sdk
v1.0.37-bate-vue2
Published
互动游戏sdk
Downloads
63
Readme
axx-slide-game-sdk
提供爱学习在线课件互动游戏相关API
安装方式
$ npm install axx-slide-game-sdk
播放器示例
import { GamePlayerSDK, IEventName } from 'axx-slide-game-sdk'
const sdk = new GamePlayerSDK();
const initListeners = (game) => {
game.addListener(IEventName.OnGameLoad, (data)=> {
console.log('游戏加载完成', data)
})
game.addListener(IEventName.OnGamePlaySubmit, (data)=> {
console.log('游戏提交', data)
})
}
const container = document.getElementById('app1')
const gameData = { id: 'c3TIvFIOfe6', params: { autoplaybgm: false, hideStartPage: 1 } }
const game = sdk.load(container, gameData)
initListeners(game)
编辑器示例
import { GameEditorSDK, IEventName } from 'axx-slide-game-sdk'
const sdk = new GameEditorSDK();
const initListeners = (game) => {
game.addListener(IEventName.OnGameEditSaveAndBack, (data)=> {
console.log('游戏保存返回', data)
})
}
const container = document.getElementById('app')
const gameData = { id: 'c3TIvFIOfe6', params: { subjectid: 7, uuid: 'c9b83898-22e1-4243-a309-cccc33a8b01a' } },
const game = sdk.load(container, gameData)
initListeners(game)