PDA

View Full Version : High Scores...




ArtOfWarfare
Aug 21, 2008, 03:49 PM
OK... I'd like to have high scores in my game but I have no idea where to get started...

I suppose what I need to know is...

1.) How do I store high scores so that even after the game is quit it'll still be there?

2.) How do I retrieve the high scores when the game loads?

3.) How can I store high scores online? (I think I'll have to buy a web domain or something to do this... I'll probably release the game without support for online high scores first and then if I make enough money from that I'll add it in a free update...)

4.) How can I retrieve the online high scores when the game loads?

... and how do I actually get high scores? I guess I want an array of high scores (which are themselves are arrays of NSStrings storing the name / score / date...)

I think if someone could provide some example code for a game with high scores that would be good...



robbieduncan
Aug 21, 2008, 03:51 PM
1) Read the documentation for NSUserDefaults (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html)

2) See 1)

3) Read the documentation for NSURLConnection (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/doc/uid/20001697), probably via a POST mode NSURLRequest

4) Similar to 3)