A sample game showing how to use Google Play Services
C++ C Objective-C Java Objective-C++ C# Other
Latest commit 8611a4b Jul 11, 2014 @Wu-Hao Wu-Hao Merge pull request #33 from fusijie/master
Upgrade gpgs to v1.1 and remove gpgs library.

README.md

Wagon War

This is an experimental project developed with Cocos2d-x 3.0 and Google Games Play Services.

The code of this project is licensed under MIT.

Musics are copyrighted by Matthew Pablo, and licensed under CC-BY 3.0

You may not use any art from this project for commercial purpose.

###Cocos2d-x

Cocos2d-x is a popular game engine for mobile devices. It has over 400,000 developers world wide, and games made with Cocos2d-x dominates top charts for iOS and Android. For more details, please visit Cocos2d-x official website.

###Google Games Play Services

The Google Play Games C++ SDK provides a C++ API for use with Google Play games services, Wagon War was developed with this C++ SDK. The following features are inclued by the game.

  • Authorization

  • Achievements

  • Leaderboards

  • Turn-based Multiplayer

###How to start the game?

Wagon War is only supported to build and run on Android deveices only.

  • Before you build the game , you must regist an account of Google Play Developer Console, and add the game to the Google Play Developer Console.

  • Clone the repository to your Mac.

  • Download the Google Play Games Services C++ SDK from the Downloads page. Then copy the /gpg-cpp-sdk/android/include/gpg/*.h to WargonWar/cocos2d/external/gpg/include/android/gpg/, copy the gpg-cpp-sdk/android/lib/gnustl/ to WargonWar/cocos2d/external/gpg/prebuilt/android/. The following image shows the library files and directory structure.

  • Enter the folder of proj.android ,open the terminal and run the following command to build .so library.

      ./build_native.py
    
  • Import the Cocos2d-x project in Eclipse.

  • Import the google-play-service-lib package and libcocos2dx in Eclipse as the dependent libraries of Cocos2d-x project.

  • Replace your app_id, leaderboards_id and achievements_id in proj.android/AndroidMainfest.xml and Classes/GPGSChecker.cpp. Don't forget to add your google test account to the whitelist in Google Play Developer Console.

  • Complie and Run.