Game
The game module provides various game-related functions. After reading the part related to your game engine on the JOGOS_SDK Introduction
page, you can use the relevant functions as follows:
window.JOGOS_SDK.game;
Game Pause/Resume
When the game is interrupted (such as ending a level, pausing the game, etc.), you must call the game pause method to inform us that the game has been paused. Do not forget to call the resume game method to inform us that the game has resumed when the game is restored or continued (such as resuming, reviving, entering the next level, etc.). The SDK will automatically handle the pause and resume when playing ads, so there is no need to call these methods repeatedly.
// Inform us that the game has been paused
await window.JOGOS_SDK.game.pause();
// Inform us that the paused game has resumed
await window.JOGOS_SDK.game.continuePlay();
Game Start/End Loading
When your game starts loading, you must call the start loading method to inform us that the game has started loading. After the loading is completed, be sure to call the end loading method to inform us that the game has finished loading.
// Inform us that the game has started loading
await window.JOGOS_SDK.game.loadingStart();
// Inform us that the game loading has ended
await window.JOGOS_SDK.game.loadingEnd();
When the game starts loading, you must call the start loading method to inform us that the game has started loading. After the loading is completed, you must call the end loading method to inform us that the game has finished loading.
// Inform us that the game has been paused
await window.JOGOS_SDK.game.pause();
// Inform us that the game has resumed
await window.JOGOS_SDK.game.continuePlay();
Happy Time
This method can be called when the player achieves a certain accomplishment (such as defeating a Boss, achieving a high score, etc.). A successful call to this method will trigger celebration actions on the website (such as launching some confetti). There is no need to call this method when completing a level or receiving a reward.
// Activate game happy time
await window.JOGOS_SDK.game.happytime();