问题
I checked [https://github.com/libgdx/libgdx/wiki/Google-Play-Games-Services-in-LibGDX][1] but that tutorial requiers me to import BaseGameUtils
from here: [https://github.com/playgameservices/android-basic-samples][2] but it seems that the BaseGameUtils
was removed. How can I go about with the implementation of GooglePlay Game services?
回答1:
I recently just implemented Google Play Games into one of my libgdx projects. Don't look at libgdx tutorials as they are outdated. You don't need a libgdx specific extension. Non deprecated modern Google Play Game services code can be found on the example projects here:
https://github.com/playgameservices/android-basic-samples
Download the whole repo to your computer, load into android studio, and play around with the code. Most of it can be simply copy and pasted to fit your needs. Worked really well for me.
The general approach I used was to write the code into the android portion of my project and then tie it into my core libgdx code using interfaces. Reference this post (the second answer, not first):
libGDX Alert Dialog
even if you aren't planning on displaying alert dialogs as shown in the above post, you can make your core libgdx project do android specific things by following this technique
来源:https://stackoverflow.com/questions/48121642/libgdx-how-to-implement-google-play-game-services