Created
December 29, 2021 17:27
-
-
Save shohan4556/4c630a51e0519753ef82182edd0deb9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ONMOInit() { | |
var isUnload = false; | |
onmoHtmlGame.init({ | |
unload: function () { | |
console.log("#unload"); | |
game.destroy(); | |
onmoHtmlGame.sendEvent(OnmoHtmlGame.EVENTS.UNLOADED); | |
isUnload = true; | |
}, | |
soundOn: function () { | |
if (!isUnload) { | |
console.log("#sound-on"); | |
SOUNDS_ENABLED = true; | |
musicPlayer.soundON = true; | |
musicPlayer.playMusic( | |
getRandomValueFromList([MUSIC_GAME1, MUSIC_GAME2]), | |
true | |
); | |
} | |
}, | |
soundOff: function () { | |
if (!isUnload) { | |
console.log("#sound-off"); | |
SOUNDS_ENABLED = false; | |
musicPlayer.soundON = false; | |
musicPlayer.pauseMusic(); | |
musicPlayer.stopSoundLooped(); | |
} | |
}, | |
pause: function () { | |
if (!isUnload) { | |
console.log("#pause"); | |
game.paused = true; | |
} | |
}, | |
resume: function () { | |
if (!isUnload) { | |
console.log("#resume"); | |
game.paused = false; | |
} | |
}, | |
seed: function () { | |
console.log("set seed ", onmoHtmlGame.seeds); | |
setSeed(onmoHtmlGame.seeds); | |
}, | |
moment: function () { | |
if (!isUnload) { | |
console.log("set moment ", onmoHtmlGame.moments); | |
setMoment(onmoHtmlGame.moments); | |
} | |
}, | |
}); | |
console.log("onmo loading event ", onmoHtmlGame); | |
onmoHtmlGame.sendEvent(OnmoHtmlGame.EVENTS.LOADING); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment