I used the following code to submit the user's score to Google Play Games:
if(getApiClient().isConnected()){
Games.Leaderboards.submitScore(getApiClient(), getString(R.string.number_guesses_leaderboard),newScore);
}
but this doesn't increment the score of leaderboard, it just replaces the score. The same value is shown the all the time. newScore
is the amount that I want to increment the current score by.
Reset a leaderboard To reset leaderboards in the Google Play Console, click Reset progress at the top of the form for that event. To reset leaderboard data programmatically, call the Management API Scores methods.
Score by placement, 1st place receives 1 point; 2nd receives 2 points, etc. The overall competitors with the lowest point wins. Score by points, 1st place received 100 points, 2nd receives 95 points, etc. The overall competitors with the highest point wins.
The term leaderboard is often used in the video gaming industry to signify rank among people who play various titles. Players can be ranked against other players based on their number of kills (most common), items collected, or some other metric.
You will need to save the current score locally using SharedPreferences
, for example, and then submit the new total score to the Google Play Games service. Have a look a this sample by the Google Play Games team, specifically their use of an AccomplishmentsOutbox
where they are storing the score locally until it is transmitted to the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With