bnunes's Forum Posts

  • 6 posts
  • I am also interested in this... anyone?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you tried the setting "Pause on unfocus"?

    What do you mean? Sorry didn’t get your tip...

    If I understood exactly what you said I want the opposite... I want to make the keep running avoiding the pause state.

    Thanks for your reply!

  • This is a chrome issue I think, where it tries to be more efficient by not running things that are tabbed out.

    Last I heard this does not apply to tabs with audio playing, so that was the workaround. You can use a short silent loop.

    Not sure if it is a chrome issue... From what I read iOS and Android simply put the app in pause state when it is not focused.

    Could you give me an example of how the silent loop would work to get gps location?

    Thanks a lot for your reply!

  • Any plans to make it for C3?

  • If all browser tabs/apps ran even in the background, it would absolutely hammer the battery life of the device. So operating systems and browsers are very strict about what can run in the background, for good reason: saving battery. Nobody wants an app to drain all their battery and many users will uninstall any apps they find wasting battery (and possibly give them a bad review).

    The question here is, what are you trying to do?

    If you want to play music in the background (e.g. music player app): you can enable playing in background on the Audio object.

    If you want to simulate real-world time passing in the game: wait until the app wakes up, measure how much time it was asleep for, and then simulate that much time passing. That has the same effect and doesn't waste loads of battery.

    If you want something else... what is it you're trying to do?

    Thank you for your quick reply!

    What I am trying to do is to get the (lat, long) positions of the user and storing it in a database. Basically, I am trying to do the following:

    on location update -> AJAX passing lat, long parameters to MySql

    The problem is that I would like to know the trajectory of the user... to check if he did it right or wrong (according to the game rules). The user can reach the right final position but I cannot evaluate if s/he followed the right path.

    I do not need to call the ajax function on every location update if I can save it in a local file and submit it later. The point is that I need to record his trajectory and when the app is unfocused it stops getting users position.

    Is there any way to do it?

    Thanks a lot!

  • Hey all,

    Any update on this?

    The same is happening to me... if the app is minimized (unfocused), it simply stops running. Is there any way to make it run in the background (unfocused)?

    I read somewhere that I should add this line to the config.xml:

    <preference name="KeepRunning" value="true"/>

    I added but unfortunately, it didn't work (yet!!!)

    Does anyone know how to make the app keeps running when it is unfocused?

  • 6 posts