phew! Finally finished part 3 of Integrating Game Center into your Lua Apps. In the process I forked @juaxix’s code on GitHub (https://gist.github.com/3887282) to allow multiple leaderboards and achievements. I’m starting to get the hang of how you link Objective C methods into Lua but I still have the “L” plates on so happy for someone to point out a better way.
In particular, rather than pass a string with the Game Center leaderboard or achievement identifier I’m using an integer (because I’m not sure how to pass a string) and then using the integer to pick out the appropriate string. This doesn’t feel particularly elegant but it does have the benefit of placing all the code where you need to put your Game Center ID’s in one file (aGameCenter_Codea.m).
I’m planning on submitting the updated version of MineSweeper (with Game Center support) to the App store.
You will notice a new MineSweeper logo on the Menu screen courtesy of @derhannes (web site at: http://www.boba-soft.com). @Fred - the mines now start falling from above the screen, thanks for the suggestion. @West - I believe the high score name bug is now sorted, thanks for catching this.
As an aside, once the Game Center code is used you can now longer test in Codea but updating, running and testing the Lua code in Xcode isn’t a bad alternate workflow (once you hard wire the runtime to reload the Lua code each compile).
Link for the Tutorial is http://codeatuts.blogspot.com.au/2012/10/tutorial-21-integrating-game-center.html