Home > Tech Geek > Implementing a Game Center button in your Corona SDK Game.

Implementing a Game Center button in your Corona SDK Game.

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.

  1. Christopher David Yudichak
    June 13th, 2011 at 11:54 | #1

    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. June 19th, 2011 at 06:13 | #2

    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. June 19th, 2011 at 08:12 | #3

    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. September 15th, 2011 at 06:22 | #4

    Hi!
    What are the news?
    Was your game finally accepted with the GC button?
    Thanks!
    Juanjo

  5. September 15th, 2011 at 08:19 | #5

    It was accepted, but I never could get OF to talk to GC, so I removed GC support in later versions.

  6. Fava
    September 29th, 2011 at 16:22 | #6

    Thanks very much! Worked like a charm.

  1. No trackbacks yet.

%d bloggers like this: