How do you restart a game reliably?

0 favourites
  • 5 posts
From the Asset Store
In this template the music plays without looping in your game
  • Hello all.

    I'm making a game where the player can travel between the layers at will, even back to layers they've already visited in the past. Each level has a layout. As such, everything that the player can interact with has "persist" to ensure that the object keeps its state when the player returns.

    I want the player to be able to restart the game. I've scoured the forums on how to do this and I've tried all the methods I've found, including resetting global variables, restarting the layout and going back to the same layout.

    None of this works!!

    Objects that were destroyed stay destroyed. Objects that had their animation frame changed don't go back to their starting animation frame.

    Surely there MUST be a way to restart the entire game!! I can't believe that there wouldn't be. Can anybody please tell me what the most reliable method of resetting EVERY object in the game back to its starting state?

    Thank you.

  • Yeah someone posted about resetting persist objects before and I don't think there was a proper solution as it's not possible. I offered the idea of making a save file of the default level structure and then when the player 'restarts', you silently load the save file.

  • No way to reset persistent objects?!?! That like buying a lock that has no key; useless 99.9% of the time. I suppose I'll have to set events at the beginning and end of each layout that reads and writes information to a series of arrays. Kind if sucks that that has to be done because persist is broken.

    Well, I assume that it's broken. If its working as intended then it really is a dud feature!!

  • Yeah I believe it's as designed at the moment. Only way to reset persist is to relaunch the game. You could reset all the items to their initial locations if 'game has been reset'. That's kinda like the load/save idea I gave above though and with that you could reset everything with one click..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Load/save idea sounds like the way to do it. Is there any word from Scirra as to whether persist functionality will ever change? Even being able to turn it on and off would be a pleasant start.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)