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

Get help using Construct 2

Post » Sun Dec 21, 2014 10:46 am

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?

Thanks,
Mike Parent
Last edited by Brashmonkey on Sun Dec 21, 2014 5:39 pm, edited 1 time in total.
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Dec 21, 2014 4:02 pm

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".
Image ImageImage
B
169
S
50
G
174
Posts: 8,327
Reputation: 110,798

Post » Sun Dec 21, 2014 5:10 pm

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.
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Dec 21, 2014 5:48 pm

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.
Image ImageImage
B
169
S
50
G
174
Posts: 8,327
Reputation: 110,798

Post » Sun Dec 21, 2014 5:54 pm

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.

Anyone?
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Dec 21, 2014 6:59 pm

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.

I WONT HELP ANYMORE IF THATS WHAT YOU WANT.
Image ImageImage
B
169
S
50
G
174
Posts: 8,327
Reputation: 110,798

Post » Sun Dec 21, 2014 7:53 pm

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.

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041


Return to How do I....?

Who is online

Users browsing this forum: khelaghor and 39 guests