How do I do this is a better way? Missing something obvious?

0 favourites
  • 11 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi everyone,

    So I'm trying to save the users score even if they close the app with the home button (for example).

    I tried using "On end of layout" but that doesn't seem to get called if you close the app externally (via red cross, home button, getting a call ect).

    I have currently resorted to saving the score every 60 seconds - which isn't ideal at all.

    Does anyone know a better way of constantly keeping track of the users score even if they terminate the app unexpectedly?

    Thanks!

  • When do you change the score?

  • When do you change the score?

    Hi Newt!

    The user score changes literally all the time. Its a kind of banking app, so the user score is always going up.

    Any clues?

  • TMAJA Have you tried the 'WebStorage' object?

  • TMAJA Have you tried the 'WebStorage' object?

    Hi Arthology,

    sorry, I wasn't clear in my original post!

    I don't have any problems actually saving the score - I'm using web storage and it all works smoothly.

    My problem is WHEN I save. Ideally I would like to save when ever the user exits the app! Unfortunately when I tried "On Layout End" this doesn't actually get called when the user closes the app via something like the home/back button on the actual phone.

    Currently I am saving the score every few minutes, which obviously is undesirable as it places unnecessary load on the phone hardware!

    Any ideas?

    Thanks!

  • Well, that all depends on the platform, if you want it mobile CocoonJS, IntelXDK or NodeWebkit, you can check put their respective plugins, they probably have some kind of quit trigger

    A possible way would saving when loosing focus

  • Hi, nice question

    I wonder how to do this too since lot of users exit with home button, open the task manager and swipe the app

    How about saving every tick but I think that will make the phone work very hard, isn't it?

  • > When do you change the score?

    >

    Hi Newt!

    The user score changes literally all the time. Its a kind of banking app, so the user score is always going up.

    Any clues?

    It was a rhetorical question.

    As in the the obvious thing you missed.

  • Well, that all depends on the platform, if you want it mobile CocoonJS, IntelXDK or NodeWebkit, you can check put their respective plugins, they probably have some kind of quit trigger

    A possible way would saving when loosing focus

    Hi Whiteclaws,

    Sounds like a great idea - how would I go about checking respective plugins? I've just had a look but I can't see a manual entry on that...

    >

    > > When do you change the score?

    > >

    >

    > Hi Newt!

    >

    > The user score changes literally all the time. Its a kind of banking app, so the user score is always going up.

    >

    > Any clues?

    >

    It was a rhetorical question.

    As in the the obvious thing you missed.

    I've really thoroughly thought about this and I'm just not seeing it? Maybe I'm just being an idiot! The score changes every tick...and surely I cant write to web storage every tick - that's going to be much worse more taxing on the hardware than writing every minute?

    Sorry if I've totally misunderstood!

    Hi, nice question

    I wonder how to do this too since lot of users exit with home button, open the task manager and swipe the app

    How about saving every tick but I think that will make the phone work very hard, isn't it?

    Hi ijoin,

    Thanks - yeah this has been something that's been bugging me for a while! I steered clear of saving every tick - I try to keep the number of every tick actions to a minimum anyway as they can be pretty hard on the limited resources on mobile - never mind if your actually writing to web storage.

    Thanks everyone!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just look at them in C2 xD, maybe there's a condition to do the job

  • I need to know how to do this also

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