Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 96

Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
08/04/12 12:49 AM (13 years ago)

Multiple quizzes

Im guessing you can put as many quizzes in your app as possible.....but.....can you link each quiz to a different leaderboardController in GameCenter? I currently have 1 quiz working great and linked to GC. Just wondering the possibilities of adding the second quiz linked to a second leaderboard? FYI- Running 2.0 on BT control panel.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
08/04/12 06:48 AM (13 years ago)
I was wondering a similar thing? I have an app that has 4 quizzes but I just made them all a similar number of questions so they could all use the same leaderboard. Is it possible to have 4 leaderboards for four quizzes? I'm running a BT self hosted control panel too.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
08/04/12 08:11 AM (13 years ago)
Yes. YOu can have diffent leaderboards for each quiz in your app. The following code is how I do it. Just set the screen name of your quiz to match the leaderboard name. It's worked in both version 1.5 and 2.0 for multiple leaderboards: //submit score -(void)submitScore{ if(totalPoints > 0) { self.currentLeaderBoard = [self.screenData itemNickname]; [self.gameCenterManager reportScore: totalPoints forCategory: self.currentLeaderBoard]; } GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if (leaderboardController != NULL) { leaderboardController.category = self.currentLeaderBoard; leaderboardController.timeScope = GKLeaderboardTimeScopeWeek; leaderboardController.leaderboardDelegate = self; [self presentModalViewController: leaderboardController animated: YES]; } } //show scoreboard -(void)showScoreboard{ GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if (leaderboardController != NULL) { leaderboardController.category = self.currentLeaderBoard; leaderboardController.timeScope = GKLeaderboardTimeScopeWeek; leaderboardController.leaderboardDelegate = self; [self presentModalViewController: leaderboardController animated: YES]; } }
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
08/04/12 08:56 PM (13 years ago)
Thanks MGoBlue you are the quiz whiz!!! Great stuff :)
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/05/12 08:47 AM (13 years ago)
Thanks MGoBlue. So 1. I replace what I already have under 'show scoreboard' and 'submit score' with the code above. 2. Create the 2nd leader board in the app details within iTunes connect 3. Make the screen nickname the same as the leader board Id's in ITC? Have I got that right? Thanks
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
08/05/12 09:06 AM (13 years ago)
Yes. That should work.
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
08/06/12 03:42 AM (13 years ago)
UPDATE: Worked brillantly!! Thankyou!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/06/12 07:56 AM (13 years ago)
awesome i can return to my quiz app
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
08/09/12 06:54 AM (13 years ago)
Excellent notes here for future use on quizzes. Thanks @ MGoBlue!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/18/12 04:29 AM (13 years ago)
How would this work with achievements say I want every quiz to have an individual attempted achievement
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/18/12 05:00 AM (13 years ago)
How would this work with achievements say I want every quiz to have an individual attempted achievement
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
11/07/12 10:01 PM (13 years ago)
this thread is exactly what I was looking for - MGoBlue you rock!
 

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.