Game close on inactivity?

Is there a way to set the game to close when there is no activity in an ex amount of time?

When the game is running, if I leave it, never closes down.



Thanks


Clarence

Comments

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,165

    Most games don't close automatically. There is a "End Game" behavior. It's a no-op on most platforms, but if there's enough of a request, we could hook it up.

    Basically mobile platforms don't like apps that shut themselves down programatically AFAIK, the user should do some kind of system swipe or button to "close" a game.

    FireTV is an exception and I think that's where the End Game behavior works, but it's been a while since I've looked into it.

  • christicchristic Member, PRO Posts: 19

    Thanks for the reply.

    The game I am working on, is for little ones. They usually walk away without closing out. So the game just sits there waiting to be played, and waiting and waiting and waiting. Most other apps that I know of well at least blank out based on iPad or iPhone settings, so I was just wondering how everyone handled this.


    Thanks again!


    Clarence

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,165

    Based on that, I think the thing to do is:

    Have an actor to detect a lack of activity. Set up a game attribute for "lastInteraction" and record the game.time whenever someone interacts with the game.

    Have an actor check that vs the current game.time and after a given timeout, initiate a Pause behavior. That will pause the game, saving battery.

    If you're on android, maybe set up another timeout inside the pause scene that that will run the End Game action. (I forget if it works on iOS, but i think you can get it work on Android).

  • christicchristic Member, PRO Posts: 19

    Wow, Thank you!!!!


    I will give that a try!!!


    Clarence

  • christicchristic Member, PRO Posts: 19

    That did it, you are amazing, thank you so much for the help!!!!

Sign In or Register to comment.