Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 9    Views: 104

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
05/13/14 12:08 AM (10 years ago)

PLUGIN UPDATED: Shark Attack - Now with Game Center

Version 1.2 - Added Game Center Integration! Shark Attack now has leaderboards. Remember, you will need to enable game center on your project settings, and setup a Game Center leaderboard in itunesconnect. The newest version of Shark Attack can be found here: https://www.buzztouch.com/plugins/plugin.php?pid=13E45EB1068BA0DFA1DBA20
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
05/13/14 07:06 AM (10 years ago)
Very nice. I was just contemplating Game Center for a plugin and may have to look at this and see how you integrated this. I just added my own scoring code to my plugin and was looking at using a remote plist file to store/display a leader board and scores. I've just never been a fan of having to "sign in" to Game Center.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/13/14 09:06 AM (10 years ago)
Yep, it's not too bad. And the code here will do exactly what you are looking to do I believe... It automatically signs you into Game Center in the background, as long as your login credentials are saved on your phone (only if you don't have this login info saved will it prompt you one time for your login info), and when your shark dies, it takes your score from the score label and posts to the high score leaderboard, all in the background. Leaderboard view is never forced upon the player either, they have to press the button to view it. Everything else is handled behind the scenes for the Shark Attack game center stuff. I know some developers said in the past that adding game center was surprisingly easy... I didn't find this to be the case at all. Even using tutorials, there is a lot of stuff that has to be added to multiple files, and they all work hand in hand. If one little thing is off, it throws things off in all the other areas, Then, once the plugin has been "Game Centerfied", the end user that submits the app has to know to turn on game center in 3 different locations, which is crazy why apple has it setup that way... the first, they have to manage their app in itunesconnect, enable game center, and setup the leaderboard. Second, they have to go to a different section of their app in itunesconnect, and enable game center in the app's overview screen (this seems very redundant to me), then third they have to go into the project settings in xcode under the capabilities tab and turn on game center from there as well. To me that workflow is nuts... why not have game center an automatic assumption by default, which would eliminate half of step 1, and all of steps 2 and 3, and just have the user create a leaderboard in itunesconnect if it's being utilized. If the app doesn't see a leaderboard, it would assume that it does not have game center capabilities... but hey, what do I know? lol
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/13/14 10:44 AM (10 years ago)
While I was in there adding the Game Center code, I also adjusted the difficulty of the default settings, for those of you that had trouble getting past the third wave of mines ;)
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
05/14/14 06:48 AM (10 years ago)
Thanks man, more great info and most of the same issues I have with Game Center. I have lots of apps that prompt me to use it but I always ignore it and move on. I figure folks will do the same if I made a plugin with it. I thought the integration with XCode 5 and GC was much improved, but sounds like it's still a lot of work :/
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
05/15/14 01:49 PM (10 years ago)
Thanks @Angy Ninja, I had missed this post about the update :) I have now installed the updated plugin. All seems to work but I note two things: - the new update does not seem compatible with IAds. With Iads enabled I can't open the game. - If one doesn't sign in for Game Center the very first time we cannot sign in later? If I click on the "Game Center" button I get the message: "Game Center Unavailable. Player is not signed in" Is this something you are experiencing? Cheers, Farcat
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/15/14 02:04 PM (10 years ago)
Hey farcat, None of the iAd code changed. What message are you getting when it's enabled? Is iAds turned on for the bundle id in iTunes connect? If not signed into Game Center, it will give that message, but if not signed in it will prompt the user to sign in each time they launch the game. If they choose cancel, hitting the Game Center button will in fact pop the message that you described. However, they can choose to sign in (or not) the next time they launch the game.
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
05/16/14 02:15 PM (10 years ago)
Thanks, got it working now. Not sure what happened, I had to delete the app for the device and clear my Derived data under Library and rebuild the project. Now it is behaving and it is a beauty. I have just submitted to Apple, can't wait. By the way, you are featured in my credits ;) Thanks again, Farcat
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/17/14 06:45 PM (10 years ago)
Sweet, you'll have to send me a link when it's published so I can check it out :)
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
05/19/14 02:31 AM (10 years ago)
Of course, will do :)
 

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.