【发布时间】:2015-04-17 13:02:33
【问题描述】:
我已按照 Google 开发者指南在我的 Libgdx 游戏中实施应用内购买。 (我已经实现了 Google play 游戏服务,所以我知道 LIBGdx 游戏中的核心代码和 Android 特定代码是如何同步的。)
但我很困惑,一旦我通过单击按钮购买了物品,我该如何更新游戏状态。例如,如果我在游戏中购买了额外的生命,我如何在主代码中更新
if (gdx.geType == ApplicationType.Android ) {
// successfully bought a life
// add +1 life in my whole game model.
}
我以前从未使用过应用内购买。 如果有人可以指导我。我已经检查了有关应用内购买的 stackoverflow 其他线程,但我仍然不在其中。
【问题讨论】:
标签: android libgdx in-app-purchase google-play-services in-app-billing