Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
04/05/12 08:33 AM (13 years ago)

Game Center coding question

So I used the Game Center tutorial to implement it into my app and it worked out I great, but I noticed that it only factors in the score and not the time which kind of makes the whole thing pointless. Does anybody know of a way that I could submit quiz scores with the quiz time subtracted...such as gamecenterscore = (quizscore - quiztime) or something like that? This would make the leadboards a lot more competitive.
 
jbrzensk
buzztouch Evangelist
Profile
Posts: 56
Reg: Oct 04, 2011
Denver
8,010
like
04/06/12 08:24 PM (13 years ago)
I add a modifier to the score that adds the score with a time bonus for each question right. It was something like this. I made a new int called quizBonusPoints, and in the BT_screen_quiz.m, found pointsPerRight, and changed it to this: if (totalSeconds >299) { quizBonusPoints = 0; } else{ quizBonusPoints = (300 - totalSeconds); } int pointsPerRight = (quizPointsPerAnswer + quizBonusPoints); I added quizBonusPoints as an int at the top of BT_screen_quiz.h, and synthesized it in BT_screen_quiz.m So if the time is less than 300 seconds, it ads a bonus to their score. If it is over 300 seconds, they do not get a bonus. So speed is rewarded.
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
04/07/12 11:19 AM (13 years ago)
awesome, that's really helpful thanks a lot
 

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.