Hey again I need help for GameCenter. Ok I know how to enabled GameCenter to my game and look at the leaderboard. But every time I finish a game the High Score displays on the Screen. But it does not display on the Gamecenter leader Board this is how I display my high score.
[code] local scores = ice:loadBox( “scores” )
local high3 = scores:retrieve(“best3”)
print(high)
local score = 0
local time = 200
local highText = display.newText("", 0,0,“Arial”,22)
highText.x = display.contentWidth/2
highText.y = display.contentHeight/3
highText:setTextColor( 0,0,0 )
local highScore = scores:retrieve(“best3”)
if highScore ~= nil then
highText.text = "HighScore: "… scores:retrieve(“best3”)
end
local function show_highScore()
gameOver = not gameOver
scores:storeIfHigher( “best3”, score )
scores:save()
local highText = display.newText("", 0,0,“Arial”,22)
highText.x = display.contentWidth/2
highText.y = display.contentHeight/2
highText:setTextColor( 0,0,0 )
if score > high3 then
if score > scores:retrieve(“best3”) then
highText.text = "New HighScore: "… scores:retrieve(“best3”)
print(“new high score”)
else
highText.text = "New HighScore: "… scores:retrieve(“best3”)
end
end
end
timer.performWithDelay(time, show_highScore, 1)[/code]
That how I display the High Score on the screen.
function updateHighScore(board, score)
if gamenetworkEnabled == true then
gameNetwork.request("setHighScore", { localPlayerScore={ value=tonumber(high3), category=board }})
end
end
gameover:addEventListener ("touch", updateHighScore)
Now This code above is suppose to post my highscore for GameCenter I think. So can anyone help me how to post score to gamecenter.
Help is appreciated thanks
[import]uid: 17058 topic_id: 20508 reply_id: 320508[/import]