Discussion Forums  >  Uncategorized

Replies: 9    Views: 948

aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
01/13/11 07:06 PM (15 years ago)

Game Center with Buzztouch?

any one tried Game Center with Buzztouch?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/13/11 09:24 PM (15 years ago)
Not that I know of. It would be interesting to hear though. I'll post if I hear anything.
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
01/13/11 09:30 PM (15 years ago)
cool, a question with the Quiz where does it submit the scores to your server?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/14/11 12:26 AM (15 years ago)
In a really really ugly bunch of code! Laughs. This is something we're trying hard to clean up, this type of thing should be obvious! So... after the quis is done, it only sends the server data if the user chooses to show scoreboard. Have a look at ScoreboardViewController.m inside the Screen_Quiz folder (this is for the iOS version, different for Android). Scroll down to the downloadData() method. This method gets called to load up the scores. When it asks the server for the results, it's posting the scores in the URL. The server inserts the scores in the database before passing back the score data. Hope this makes sense.
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
01/14/11 06:18 AM (15 years ago)
thank you so much to pointing me there. i have successfully replace the sever based one with game Center
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
01/14/11 06:26 AM (15 years ago)
Integrating Apple GameCenter to your iPhone Application Step 1: Create a AppID on Provisional Portal -( http://developer.apple.com/ios) Make a new AppId and make sure you spell out the bundle identifier properly so game center can be enabled for it for eg: com.buztouch.testquiz Once you do this GameCenter is enabled by Default Step 2: Create an Application on iTunes Connect and configure GameCenter for the App Click on Manage Game Center Click on Enable button to enable GameCenter for this app You will see 2 sections now LeaderBoard, and Achievements Go ahead and click on Setup for LeaderBoard, we will do Achievements once we setup LeaderBoard You will see the following screen ? Go ahead and select Ascending or Descending depending on your Leaderboard order Select the Format type depending on your game play, it can be integer, decimal, time or money Once you select this Add category and Score Format Localization will be active. Click on Add Category and you will see a modal window popup. It has 2 fields, you will be using the categoryID to access the leaderboard. Category Reference Name: Test LeaderBoard Leaderboard Category ID: testleaderboard Hit Save IMPORTANT ? The app uses the Bundle ID and the leaderboard category together to access the leaderboard from GameCenter. Next click on Add Language and a modal popup will show up to add a language. These are self explanatory Language: Select Language Score Format: Select the one that applies Score Format Suffix (Singular): you can add things liks point or say Dollar or say cent or sec?. depending on your game or leave empty if you dont want any suffix Score Format Suffix (Plural): Same thing as above but for plural Category Title for Test LeaderBoard ? What Title you want for this particular Category ? It will show up on top of the leaderboard navigation bar Hit save will close the popup Hit Save and thats it for leaderboard.
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
01/14/11 06:33 AM (15 years ago)
Step 3: Xcode ? open your buzztouch Created app where You will be implementing the above Step 3a: Implementing leaderboard Open Xcode Add the GameKit Framework to your Frameworks (right click on Frameworks folder ? click on Add existing frameworks ? and Pick GameKit.framework) Go to Info.plist file( your info.plist file) and in Bundle Identifier add your identifier you created using your provisional profile appid ? com.buztouch.testquiz Next go to the application folder then AppViewController h file and add the following #import #import Next go to .m file (AppViewController.m) and add the following (after //did rotate ) // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){ if (error ==nil) { NSLog(@Success); } else { NSLog(@Fail); } }]; }
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
01/14/11 06:40 AM (15 years ago)
Then go to the Quiz Screen folder open TakeQuizViewController.h and add #import Replace @interface with @interface TakeQuizViewController : UIViewController { add where all the Int are int gameCenterEnabled; int gameCenterPlayerID; int gameCenterPlayerAlias; int viewLeaderboard; add where all the -(void) are -(void)viewLeaderboard; open TakeQuizViewController.m relpace from //build string with scores and times.. to #pragma mark call action sheet methods with //build string with scores and times.. GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@2011003] autorelease]; myScoreValue.value = totalPoints; [myScoreValue reportScoreWithCompletionHandler:^(NSError *error){ if(error != nil){ NSLog(@Score Submission Failed); } else { NSLog(@Score Submitted); } }]; NSString *myResultMessage = [NSString stringWithFormat:@Correct Answers: %@\nIncorrect Answers: %@\nTotal Score: %@\nElapsed Time: %@, [self.quizResult numberRight], [self.quizResult numberWrong], [self.quizResult totalPoints], elapsedTime]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:myResultMessage delegate:self cancelButtonTitle:nil destructiveButtonTitle:@Quit otherButtonTitles:@Try Again, @Show High Scores, nil]; actionSheet.destructiveButtonIndex = 0; [actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque]; [actionSheet showInView:self.view]; [actionSheet release]; } then add // Show the Game Center leaderboard - (void) viewLeaderboard { GKLeaderboardViewController *lb = [[GKLeaderboardViewController alloc] init]; if(lb != nil){ lb.leaderboardDelegate = self; [self presentModalViewController:lb animated:YES]; } } - (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController { [self dismissModalViewControllerAnimated: YES]; [viewController release]; } and thats it.
 
mitchellapps
Aspiring developer
Profile
Posts: 170
Reg: Aug 15, 2011
St. Louis
4,300
like
11/06/11 12:39 PM (14 years ago)
When I go to #import while following your directions, it asks for a header. What is the proper header?
 
Kahuna
Apple Fan
Profile
Posts: 137
Reg: Nov 18, 2011
Milan
4,670
like
12/19/11 09:58 AM (14 years ago)
Hi, I tried to follow this advices adapting them to for BT 1.5 but couldn't get it work. Did anyone implement Game Center with BT 1.5? I succeded in getting the test user login in the app but cannot submit the score :( Kahuna
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.