LibGDX: How to Implement Google Play Game Services? [closed]

折月煮酒 提交于 2019-12-08 07:29:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!