if (GetBoolean(game, "inprogress")) {
// game is in progress. Restart things based on current state
} else {
// first time launching game.
game.inprogress = true
}
jaynabonne wrote:You could probably implement the function "InitUserInterface" mentioned above and then clear the screen. You'd probably also have to show the room description again so that the player isn't facing a blank screen. (It does mean that from the player's point of view, save/restore don't put you back in the same state you were before. Before the save you had all the previous text to look at, whereas after a reload you don't. But that's your design decision.)
jaynabonne wrote:You should be able to restart the audio in InitUserInterface. What I was thinking (even for my own game) is to set a flag the first time through on the game object. That flag will be persisted during a save and reload. When the game is reloaded, you'll see the flag set and know it's not the first time. Something like:if (GetBoolean(game, "inprogress")) {
// game is in progress. Restart things based on current state
} else {
// first time launching game.
game.inprogress = true
}
jaynabonne wrote:Where it says "Restart things based on current state" in the comment, that's where you'd put in your specific code to restart whatever you wish (audio in this case).