0

ive got a simple scoring system in a corona SDK game im making. It works well I have just been having trouble getting the score and saving it to Game Center... Heres the Code that displays the score on the screen

storyboard.state = {score = 0}
score = display.newText(storyboard.state.score, 35, 0, system.nativefont, 16)

Heres the Code that updates the score.

    storyboard.state.score = storyboard.state.score + 1
score.text = storyboard.state.score

And here is where i want it to go to after the game finishes.

 gameNetwork.request( "setHighScore",
 {
 localPlayerScore = { category="MyLeaderboards ID", value=25 },
 listener=requestCallback
 })

It would have to go after the value=.. its default 25 and ive tried a few things to no use. I'm extremely new to this sorry if its an extremely easy question. Thanks

4

1 回答 1

0

您确定“类别”吗?根据文档(http://docs.coronalabs.com/api/library/gameNetwork/request.html),它应该与“您在 iTunes Connect 上输入的要注册分数的排行榜的 ID”匹配。

你确定你已经登录了吗?这是提交高分的强制性要求。http://docs.coronalabs.com/api/library/gameNetwork/init.html

于 2013-07-23T12:55:06.863 回答