-
Notifications
You must be signed in to change notification settings - Fork 2
Achievements and Leaderboards
Janzku edited this page Nov 21, 2014
·
1 revision
To use and to publish game in Google Play, you will need at least 5 achievement in your game. These features require player to have and log-in to (Google) Play Games.
You will create achievements and leaderboards in Google play Developer Console, where you will see their IDs.
To use your created achievements in your game is quite simple. You have 3 functions to use:
-
UnlockAchievement(achievement_id)
-
IncrementAchievement(achievement_id, steps)
-
ShowAchiements()
- To unlock achievement, you simply call
uthGPGS.achievement.UnlockAchievement("id");
from engine. This also unlocks and makes hidden achievements unhidden. - To increase steps in achievement that has steps, use
uthGPGS.achievement.IncrementAchievement("id", steps);
to progress achievement as many steps you want. - To see all your achievements, simply call
uthGPGS.achievement.ShowAchiements();
which will call built-in achievement viewer and pause your game activity.
To use your leaderboard(s), you have 2 simple function to use:
-
SubmitHighScore(leaderboard_id, score)
-
ShowLeaderboard(leaderboard_id)
- Whenever you want to submit score to a certain leaderboard of your choice, simply call
uthGPGS.leaderboard.SubmitHighScore("id", score);
. However one player can only have one score on leaderboard. Submitting lower score than previous one does not update that players standings. - To show leaderboard to a player, call
uthGPGS.leaderboard.ShowLeaderboard("id");
to show built-in leaderboard viewer. This also pauses your game activity.