Game Development Community

where should i put save data when i press home button

by Apppothk · in iTorque 2D · 03/29/2011 (8:14 pm) · 5 replies

i try to put my save Data function on oniPhoneResignActive,
but sometime it will lose some data when i counitue my game.

i also try to put my saveData to my mainGame when i have action.
it work well and will not lose some data but it will little lag.

function oniPhoneResignActive(){  
    saveGameData();
    if($game::isItInGameScreen==1){
         if($game::mode==0)
            saveTimeModeData("timeModeDat");
         if($game::mode==1)
            saveTimeModeData("freeModeDat");
    }
 } 
 
 function oniPhoneBecomeActive(){
    
 }
 
 function oniPhoneWillTerminate(){
    
 }

#1
03/30/2011 (11:18 am)
Firstly, there could be an issue with the routine you're using to save with it would be worth posting that as well.

Secondly, you're only given so much time to perform a save so it's worth checking how long it takes to perform a complete save.
#2
03/30/2011 (11:26 am)
I create a FileObject and write to a file in my game/data/saved directory. I write 1 file that stores all data needed for all profiles and current state, etc.

Where does it actually save the file? I have no idea. Nor do I care. It works and that's all that matters to me.
#3
03/30/2011 (12:11 pm)
I can't remember the name but there's only one place files can go anyway, I'm suspecting iTorque makes that the root directory at a guess.
#4
03/30/2011 (12:19 pm)
Side question, have you guys had any problems with save data maintaining when you update versions of the game from the app store? I've only ready about it, but am wondering if it is an issue or not for iT2D games.
#5
04/06/2011 (2:32 pm)
I think it's not an issue, cause u can refresh your install in the phone, and the file remains there with all your data saved.