0 Favourites

How do I run the game in background crosswalk

  • How do I run the game in background - crosswalk? It's made to count while the user can do different stuff. But when the Android phone is minimized the game, it stops counting. So i made a plugin to run crosswalk in background :

    But still negative results, what am i doing wrong ?

    Plugin & CAPX :

    APK Demo :

  • Ashley is it not possible to run Construct2 games in background ?

  • It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

    Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.

  • Yes if the whole game is running in background it can drain the users battery. But is it not possible in construct2, to do certain functions in background ?

  • Ashley

    In official multiplayer plugin, runtime.js, line 125, 318. It looks like the host player could run while suspended, i.e. in background.

  • Ashley

    In official multiplayer plugin, runtime.js, line 125, 318. It looks like the host player could run while suspended, i.e. in background.

    It has been discussed and the awnser was that it was the only exception, made to not break multiplayer games, still not supported everywhere else though.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Yes, the host of a multiplayer game will keep the game active since they are acting as a server, and if the server suspends then all connected peers will hang too, even if their games are active. This is the one valid exception to the rule. I do not believe there are any other good reasons to use up power and system resources in the background.

  • Ashley

    Aphrodite

    I agree that suspending when application is in background, to save battery.

    But it could not cover all cases.

    For example

    • A game/application which running at PC only, it does not have battery problem.
    • A game/application need to have running in background feature in spec.
    • Designer does not know how to do when game resumed, and the deadline is coming...
  • It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

    Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.

    How do we measure how long the game was suspended to have a similar feature to the build/upgrade time in a game like Clash of Clans and other MMORPG game apps?

  • > It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

    >

    > Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.

    >

    How do we measure how long the game was suspended to have a similar feature to the build/upgrade time in a game like Clash of Clans and other MMORPG game apps?

    User connection disconnects -> register server date 22/10/2015 12:55 as time for user xxx

    User connection connects -> register server date 23/10/2015 13:33 as time2 for user xxx

    Compare time & time2.

    Your answer.

  • >

    > > It's not supported because it's a terrible idea: it will rapidly drain the user's battery. Imagine if all the apps on your phone did that.

    > >

    > > Instead when the app resumes, measure how long it was suspended, and then advance the counter according to how much time had passed.

    > >

    >

    > How do we measure how long the game was suspended to have a similar feature to the build/upgrade time in a game like Clash of Clans and other MMORPG game apps?

    >

    User connection disconnects -> register server date 22/10/2015 12:55 as time for user xxx

    User connection connects -> register server date 23/10/2015 13:33 as time2 for user xxx

    Compare time & time2.

    Your answer.

    What object was used to create those events, I have looked through some of the provided default objects but cannot find anything similar other than the Browser object. But how do we connect to a web server with a variable?

    Thanks!

  • What object was used to create those events, I have looked through some of the provided default objects but cannot find anything similar other than the Browser object. But how do we connect to a web server with a variable?

    Thanks!

    Ajax plugin, you can look at this example :

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