Skip to content

spookygames/gdx-gameservices

Repository files navigation

gdx-gameservices

Game services wrapper for libgdx.

Currently supports Google Play Games on desktop and android and Game Center on iOS (using mobidevelop's roboVM fork).

Setup

Your project needs libgdx >= 1.10.0.

Add following bold parts into your build.gradle file:

    allprojects {
        ext {
            gdxGameservicesVersion = '3.0.0'
        }
    }

    ...

    project(":core") {

        ...

        dependencies {
            ...
            compile "games.spooky.gdx:gdx-gameservices:$gdxGameservicesVersion"
        }
    }

    // For Google Play Games on desktop
    project(":desktop") {

        ...

        dependencies {
            compile project(":core")
            ...
            compile "games.spooky.gdx:gdx-gameservices-googleplay-desktop:$gdxGameservicesVersion"
        }
    }

    // For Google Play Games on Android
    project(":android") {

        ...

        dependencies {
            compile project(":core")
            ...
            compile "games.spooky.gdx:gdx-gameservices-googleplay-android:$gdxGameservicesVersion"
        }
    }

    // For Game Center on iOS (roboVM)
    project(":ios") {

        ...

        dependencies {
            compile project(":core")
            ...
            compile "games.spooky.gdx:gdx-gameservices-gamecenter:$gdxGameservicesVersion"
        }
    }

Usage

General word

Most methods take as result an AsyncServiceResult object, exhibiting three methods: onCompletion(...), onSuccess(...) and onError(...). These methods accept a Listener where you will be able to use the result of your call.

Demo usage

Service-specific shenanigans

Feature support

Platform Connection Achievements Leaderboard Saved games
Google Play Games (android)
Google Play Games (desktop)
Game Center (ios - roboVM)