How does xcode handle variables?
Now my question might be a little vague but heres what I'm trying to ask. How would I be able to store a variable...close an app, reopen, and have that variable kept as a sort of permanent/temporary track of how well the gamer is doing?
So far with the game I've coded I've noticed that every time the game closes/switches to another view/ the game starts off from scratch with the initial 0s for the score and so on. I want to change that so it at least keeps or maintains them until the user presses a reset button (which I haven't added yet, but I'm sure it won't take long to figure out). (granted I know I'm going to have to save and load the numbers from a file or something similar {but I don't know how, yet}.
So what I've got: A fully functioning game that only keeps track of the score when you're actually playing (I know I'm a serious gamer but I know the importance of a break) and a semi-clear understanding of how xcode works (I'm still getting the hang of it).
Oh and of coarse if the user would like to post the highscore *my score relies on two variables a total and a percent (of coarse a higher total represents a better score [due to effort] so long as the percent isn't low)...where/how exactly does that work? From my understanding its a simple server universal to iphone apps called Game Center w/ leaderboards for every app/game and a sort of framework kit or other in xcode that has some predefined code to send in scores.
Any help would be appreciated, my game will not be going on the market all too soon. I'm still in the process of cleaning up the graphics (It looks terrible, I'm no artist).
|