Detect game closed/reopened - for multi-tasking
I would like to detect if an iOS app has been exited with the home button and I would also like to be able to detect when the player returns to the application (when multi-tasking is enabled for this app).
This would be useful for many reasons. One example is for an action game: When you press the home button it quits... then when you return to the game via the multi-tasking-bar or icon, the game doesn't immediately start, but it can be paused until the player clicks a button to start.
Re: Detect game closed/reopened - for multi-tasking
I think I just worked out a way to do this but I haven't tested it. You could use an INI object and when the game starts set "GameStarted=1". Then when you finish a game (player dies or wins, etc) you set "GameStarted=0". Then at the start of the application if "GameStarted=0" you know that the game was quit mid-game and you can load a game from the appropriate position.
Native support would be good, but I think that's a neat workaround.
:)
Re: Detect game closed/reopened - for multi-tasking
> Then at the start of the application if "GameStarted=0" you know that the game was quit mid-game and you can load a game from the appropriate position.
The question is, if you set your app to run in the background, when you get back to it after the user left for a while, will it be considered "start of application" in MMF?
Re: Detect game closed/reopened - for multi-tasking
It won't be - I forgot to mention I was assuming you're using Multitasking set to off. So it's not a perfect work around, but for simplistic games it will work. (Resume the last level they were on, but not the complete "state" of the level).
Re: Detect game closed/reopened - for multi-tasking
Then I add +1 for the events "On HomeButton Pressed" and "On Game Resumed" for multitasking-enabled games. Those will allow us to pause/resume games where needed.
Re: Detect game closed/reopened - for multi-tasking
The application is already, and automatically put into pause when quitting the active state, and resumed when coming back. No need to do it yourself.
Re: Detect game closed/reopened - for multi-tasking
Francois did you read why I thought this would be useful?
Imagine the situation where you're playing a very fast paced racing game and you're about to hit a wall. You click the home button because you need to pause it temporarily to get up and walk somewhere (or someone calls you), and then when you resume the game using no detection of the application being resumed, and you immediate crash into a wall because you had no time to react.
Now imagine the scenario with pause detection: When you come back to the game it says "Tap anywhere to continue". The player can see that they are about to crash into a wall and takes a few seconds to work out what they're going to do next before resuming the game by tapping the screen.
Re: Detect game closed/reopened - for multi-tasking
It would be a useful feature to have if possible to do.
Re: Detect game closed/reopened - for multi-tasking
Ha OK, I did not understand it correctly.
I'll see what I can do.