You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to figure out how to implement replays and ghost mode and I'm having trouble understanding it.
I imagine I will listen to event "start" for event.detail.opt_replay or event.detail.opt_ghostMod but then I have trouble figuring out, where I would store the data necessary for replication moves of the player/ghost.
In the docs, there is:
var saveState = data.saveState; // contains data you previously saved
var replayData = data.replayData;
var ghostData = data.ghostData;
var socialData = data.socialData;
for gamee.gameInit but for gamee.gameOver there is only mentioning of storing one object. I need to store some user personalisations/progress like in game Basketball Bunny and I want to avoid conflicts/confusion in Ghost Mode between data of the user playing, and data of the ghost player.
Any additional docs would be appreciated.
The text was updated successfully, but these errors were encountered:
Things said shortly before we update the documentation.
The original idea was the data for the replays and the ghost modes will be exactly the same. So when the gamee.gameOver occures you store just one data available for both features.
In the doc there is (was) a mistake. This doesn't exist: var ghostData = data.ghostData;
===
To your question, to store the personalized data of the current player use the gamee.gameSave method anytime during the gameplay. The next time this and only this player will play the game will receive the data as
var saveState = data.saveState; // contains data you previously saved
The recommended strategy is to call this method after each significant progress. Specifically in the Bunny game, each time player finishes the mach gamee.gameSave is called, then each time player spends the ingame coins to buy a ball for example.
To store the replay|ghost mode data the game must call the gamee.gameOver which also terminates the game. Then playing the replay|ghost mode will be available to other players from the GAMEE feed. There is one condition it will appear in the feed only if it is the highest reached score of this player in that game.
Once another player selects to play the ghost mode from the feed, upon the start the game will receive in the game.gameInit:
var saveState = data.saveState; // personalized data of the current player
var replayData = data.replayData; // data to replicate the ghost mode|replay of another player
I'm trying to figure out how to implement replays and ghost mode and I'm having trouble understanding it.
I imagine I will listen to event "start" for
event.detail.opt_replay
orevent.detail.opt_ghostMod
but then I have trouble figuring out, where I would store the data necessary for replication moves of the player/ghost.In the docs, there is:
for
gamee.gameInit
but forgamee.gameOver
there is only mentioning of storing one object. I need to store some user personalisations/progress like in gameBasketball Bunny
and I want to avoid conflicts/confusion in Ghost Mode between data of the user playing, and data of the ghost player.Any additional docs would be appreciated.
The text was updated successfully, but these errors were encountered: