How do I make sure game doesn't reset when paused on IOS

0 favourites
  • 7 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hi everyone,

    I've got a nearly finished game which I'm using Cocoonjs to export for IOS. The game runs ok on IOS devices BUT whenever the user presses the home key, instead of the game pausing so that it can be resumed, it resets...meaning when the user goes back to the game, instead of the game re-opening where they left off, the game reloads from scratch.

    Is there a setting I'm not spotting somewhere that would fix this issue, or does it depend on the memory consumption of the game etc etc?

    Any ideas or insight?


    Mike Parent

  • A lot of conditions don't work in safari, end of layout, on resize, etc, but they may with Cocoon, or it may have some conditions that can check. Im not set up to export to it so I can't check.

    The ideal way would be to use local storage to save the games state, "on end of layout".

  • But it has nothing to do with end of layout. I'm talking about when someone temporarily leaves the app by pressing the home key. I think you don't understand what I'm asking.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Supposedly "end of layout" is triggered when the project closes, as well as when you go to another layout.

    I have yet to see that work for the close, as its "goggles" on Safari.

    There are no other conditions that meet that criteria, except for possibly "on resize".

    The other option, unless "someone" adds something for mobile, is to save the state periodically.

  • Again, I'm pretty sure you are not talking about the same thing I am. I'm using Cocoonjs to export the game through xcode as a native IOS app. This is NOT a web game on safari or otherwise. No frame is being left, no game is being closed.

    I've made other games for IOS with other authoring systems and the games properly PAUSE when you press the home key on the device... Pressing the home key should NOT close the app, it should pause the app, as the device oes back to the home screen so the user can do whatever they want with other apps setc...but then the player is supposed to be able to -REENTER the app where they left off. this is NOT reloading the app through a save file, the app WAS NEVER CLOSED, just minimized.

    For some reason my game is restarting from scratch when the user minimizes it by pressing the home key.


  • There is no direct solution. I've given you a workaround unless, either Ashley, or Ludei, create something to fix it.

    I am not set up to test on Cocoonjs, so I do not know if it will work.

    I did test on Safari, and it does not work.

    Its an Ios problem, so it's doubtful Ashley will add anything to fix it.


  • Hi Newt. I appreciate you were trying to help, but due to a lack of familiarity with the issue you were not helping and I was trying to make it clear that you were on the wrong track due to a lack of knowledge of the issue, and therefore wasting your own time, and possibly derailing the conversation and making it less likely for someone else to help, thinking you had "resolved the issue".

    Also, my apologies if my use of caps was offensive, I'm an old fart and not used to the notion that caps for emphasis comes off as screaming to non ancient people.

    It is definitely not an IOS problem, and in fact, I found the solution. I had, a long time ago set the starting layout to the actual first layout of the game, instead of leaving it as "default". It seems, despite being unintuitive, this is the setting that makes the game restart from that layer when you maximize the game after having minimized it.

    So, that seems to be the actual answer and solution for the problem, which as you can see has nothing to do with an IOS problem, and certainly trying to program the game to save on exit and reload I a very hacky solution to accidentally setting the starting layout the wrong way in C2.

    This is why I was repeating myself, and why I was using caps for emphasis on the key topics I felt you were not considering carefully enough. None of it was meant to be rude or unappreciative, I was only trying to stay on point and not digress into issues that while seemed related to you, actually were not at all related.

    I really respect and appreciate your helpfulness and in general I'm sure you're very knowledgeable, and again, I apologize if my attempts to clarify the situation came off as rude.

    I do appreciate your helpfulness and hope I haven't offended you or decreased your likelihood of helping in the future.



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