Below is the code, I’m using gameNetwork UI library. I was trying to implement leaderboards for ghost vs monsters game using corona cloud dashboard.
[lua]
leaderboardID = “517da9f12befXXXXXXXXXX”
leaderboards = cloud.leaderboards
achievementID=“517c7071XXXXXXXXXXXXX”
achievements = cloud.achievements
local function achievementsListener( event )
--handle achievements events here
end
achievements.setListener( achievementsListener )
local function leaderboardsListener( event )
--handle leaderboard events here
end
leaderboards.setListener( leaderboardsListener )
– GAME OVER WINDOW
local gameOverDisplay
if isWin == “yes” then
gameOverDisplay = display.newImageRect( “images/youwin.png”, 390, 154 )
– Give score bonus depending on how many ghosts left
local ghostBonus = gameLives * 20000
local newScore = gameScore + ghostBonus
setScore(newScore)
--your leaderboard ID.
print(newScore)
leaderboards.submitHighScore( leaderboardID, newScore )
achievements.unlock( achievementID )
else
gameOverDisplay = display.newImageRect( “images/youlose.png”, 390, 154 )
end
[/lua]
The unlock achievement worked but not the submit highscore!
Thanks,
Vinod