Can i set the game, when i press "home" don't leave the game?
by Apppothk · in iTorque 2D · 03/25/2011 (3:52 am) · 9 replies
Can i set the game, when i press "home" don't leave the game?
now my game is when i press home button, it will leave game totally.
can i set it don't leave the game?
now my game is when i press home button, it will leave game totally.
can i set it don't leave the game?
#2
What you need to do is save your level state when this occurs and restore it when the game is reloaded.
03/25/2011 (6:57 am)
@Apppothk - Except in very special circumstances all iOS programs should fully close when home is hit.What you need to do is save your level state when this occurs and restore it when the game is reloaded.
#3
03/25/2011 (7:37 am)
You can catch that signal to save your game state or user progress, but you should never even consider overriding an Apple iOS process.
#4
03/25/2011 (7:24 pm)
i am sorry, the problem is when i hit home, the game will leave, i would like to make when i hit home, the game will stop and go to ios main screen. when i touch my game icon, it will go back to my game in stop stage.
#5
That's just how iPhone apps work. iOS still doesn't have true multitasking, only one program can be open at once.
03/25/2011 (9:51 pm)
Like Michael says you have to see the signal the iPhone transmits to say the home button has been hit and save all your objects and global variables ready to reload when the user clicks back in.That's just how iPhone apps work. iOS still doesn't have true multitasking, only one program can be open at once.
#6
iOS has no full multitasking, but it has true multitasking but only for application types where its acceptable to run permanentely.
This covers audio players, voip, location software. The rest is only allowed to finish its task and then its sent to sleep (normally this send to sleep means it just gets no processing time but if RAM gets scarse its terminated). Android behaves similarly, just that it allows all applications to run but if RAM is full then the currently active program will get preference while the background ones get killed.
This is discussable if it is smart or not, as its not reasonable nor userfriendly to force users to kill applications manually that otherwise run in the background - and even on that end iOS is better! (iPad2 kills xooms battery life by 2 hours and thats at least partially related to how the OS forcefully preserves the battery life)
03/26/2011 (5:36 pm)
Thats incorrect.iOS has no full multitasking, but it has true multitasking but only for application types where its acceptable to run permanentely.
This covers audio players, voip, location software. The rest is only allowed to finish its task and then its sent to sleep (normally this send to sleep means it just gets no processing time but if RAM gets scarse its terminated). Android behaves similarly, just that it allows all applications to run but if RAM is full then the currently active program will get preference while the background ones get killed.
This is discussable if it is smart or not, as its not reasonable nor userfriendly to force users to kill applications manually that otherwise run in the background - and even on that end iOS is better! (iPad2 kills xooms battery life by 2 hours and thats at least partially related to how the OS forcefully preserves the battery life)
#7
03/26/2011 (8:34 pm)
@Marc - Depends on your definition of true multitasking. If iOS doesn't allow me to fully multi-task every element of my application, for me it's not true multitasking.
#8
04/05/2011 (2:39 pm)
This is really wrong. The game should pause when the home button is hit, and resume right where it left off when you select it again, on 3Gs and above devices. We implemented a fix for this that I found on this forum, and for Trampoline Girl it works perfectly. This is how all other games work. What is the deal? I thought this was implemented in 1.4.1?
#9
http://www.garagegames.com/community/forums/viewthread/118571
Kudos to Craig Fortune and Robert Hughes for fixing this so our games work like the rest of the app world!
04/05/2011 (3:05 pm)
Here is the code I used to achieve this but I don't know if it works with 1.4.1. I really thought this was going to be in the new version.http://www.garagegames.com/community/forums/viewthread/118571
Kudos to Craig Fortune and Robert Hughes for fixing this so our games work like the rest of the app world!
Torque Owner Chris Labombard
Premium Preferred
If I hit Home I intend to go home, why would you want to remove it?