Implementing a Game Center button in your Corona SDK Game.

Posted by & filed under Tech Geek.

I’ve been trying to figure out how to do a Game Center button for my game and be able to link to the Game Center leaderboards and achievements directly from my Corona SDK based game.

I had not found much information on the Internet on how to do this. Most examples were involving Objective C using Xcode and adding the Game Center framework to the game, then calling relevant methods from the framework.

I basically gave up on the idea about connecting directly to the leaderboards and decided to just try and launch the Game Center app from my game.

Here is the code I used (mostly lifted from Jayant C Varma’s “rating.lua” file found on the Corona SDK site):

And much to my surprise, it works like a charm. Now to track down those pesky specific URL’s…. I should note, this is a new addition to my game and it has not been submitted to Apple yet. No warranties expressed or implied.

8 Responses to “Implementing a Game Center button in your Corona SDK Game.”

  1. Christopher David Yudichak

    Well done. I knew something like this had to exist. Just added it to my game; thanks for the research. Side note…I’ve continued researching now, but can’t find any other URLs with the gamecenter: scheme. Perhaps that’s all there is?

  2. Alejandro Jimenez

    Hey dude that’s awesome! Didn’t find any info on it before, thank you very much!

    A little question on this… do you know if there’s any possible way to update gamecenter achievements without having to deal with openfeint first? My users are starving for that! :-S

  3. rmiracle

    Not that I’m aware of. Many of us would like Ansca to give us just Game Center support, but I suspect they have a lot of higher priority items, including all the iOS 5.0 goodies to implement and since we get Game Center for free with OF, I expect its lower on the list.

  4. Scott D.

    @rmiracle
    Do you know what URLS schema needs to be used to launch game center to show a specific game and page (Leaderboards, Achievements) like Angry Birds Free version on iOS does?

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">