Handle mobile device's lifecycle w/ C2

0 favourites
  • 7 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • Good Evening Gentlemen,

    I am eager to know if there is any way to handle lifecycle events on mobile devices? I.e. I want my game to save the player's progress when my app is minimized on android or iOS devices. Are there any common practices to achieve that?

    When coding a native app for Android (as an example) you can always respond to onPause() or onStop()-Events and put all your data- or game-saving-code in there. Is there any system-event or something that is triggered when the app is minimized or "short-to-be-terminated"?

    Are there any other common saving-procedures that the dedicated C2-user should use?



  • Hi again. No ideas? I was thinking about regularly saving my game in fixed time intervals or game events. But both options do not really suit the style of my game... Any ideas?

  • You would need to look at cocoonjs or appmobi objects to see what device options are supported. You should also look at web storage for saving data between plays, etc...

  • The Browser object's 'On suspended' and 'On resumed' are the right triggers for this. You could do something like write to WebStorage in 'On suspended'.

  • Hi BluePhaze and Ashley,

    thanks a lot for your responses. As far as I can see, the CocoonJS and Appmobi objects do not support those triggers.

    Ashley: That's great news. However, doesn't the CocoonJS-Tutorial state that Construct 2's "Browser-Object" is not being supported?


    EDIT: Oh I see. The Tut states that "Most features of the Browser object are not supported." - Is there a list out there that says which features are supported and which are not?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • These triggers are supported on all platforms. I think they're pretty much the only Browser object features that work in CocoonJS and directCanvas.

  • Thanks a lot, Ashley!

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