Hello! This is my 2nd tutorial… I found some tutorials but it was chaos in it or it was not in English… So i hope i will help you. I will do only Main blocks if u want others then comment!
-
Google Play Games Component
Add Google Play Games component
- You can see youo dont have to set nothing… BUT you have! so click on Settings → API keys and first box… That we want… There you must get APP ID from google play services from console.
So this number… ID of project… It is located next your app icon and then paste it in the box…
-
Adding ID
After adding your ID we have to add some buttons (to sign in for example)
There we have all blocks from this component… so lets start with sign in…
-
Sign in
So there we Sign in after button click and then we can choose our account (because of false if true then we use last signed account)
Then we need toGet.Player
when we sign in so…
There it is… When we Sign in we get our player… -
Leaderboard
We need again ID but not of app but of leaderboard which we create in console…
When screen is opened then we submit our score (which we get fromlabel.text
) and it send score to Google leaderboard of your app which is connected by ID of leaderboard. -
Achievements
We have to again get ID from achievement which we create again in google play console
This one is easy…
We get our achievement when we open the screen…
Another kind of achievements is i would say incremental which we decrease total score to get our achievement for example : Score 1000 points
Again when we open the screen we increment score to get our achievement
And we can get our menu of achievements from this…
-
Sign out
When we click on button we sign out…
That should be all i hope i helped you… This component has one bug also which i got in my app… when i tried sign in i just cant and it was because i had different SHA- 1 key in Google Play console and in Google Cloud Console… So you have to change it in Google Cloud Console (search your app in it and then click on credentials and change the from your google play console)
Good luck in koding!