Giter VIP home page Giter VIP logo

gamemanagersamples's Introduction

Game Manager API Samples for Google Cast

This is a collection of samples using the Google Cast Game Manager API. The Google Cast Game Manager allows native Android, iOS, and Chrome games to connect with a Google Cast device and have communication and synchronization of player and game states across devices.

  • SpriteDemo: A hello world application. The simplest sample using the Game Manager APIs that lets devices add sprites on the TV.

  • StarCast: A simple multiplayer shoot-em-up. The Android and iOS versions can control a spaceship. The Chrome version can control up to 4 spaceships using the keyboard.

  • SpellCast: Team up with up to 3 friends and draw arcane symbols on your device to cast spells and defeat monsters! This sample shows examples of the Cast Game UX guidelines (PDF), such as setting up a multiplayer lobby.

  • GameDebugger: A utility that lets you see game state, view the messages being passed around, and connect new players. Works with the Game Manager Debug UI on the TV.

Dependencies

Android

  • google-play-services_lib library from Android SDK (at least version 7.5.71)
  • android-support-v7-appcompat (version 21 or above)
  • android-support-v7-mediarouter (version 20 or above)

iOS

  • google-cast-sdk (at least version 2.7.0)
  • google-cast-games-sdk (at least version 2.7.0)

These can be installed using Cocoapods.

Chrome

  • Google Cast extension (at least version 15.605.1.0)

Setup Instructions

Each sample includes code for the Android sender, iOS sender, Chrome sender, and the receiver. Note SpellCast and GameDebugger only have minimal Chrome senders that let you interact with the receiver using the Chrome devtools console.

Review the Google Cast SDK Get Started Guide before setting up these samples.

Android

  • Check out code from GitHub and go to a sample subfolder under android-sender with a build.gradle file.
  • In Android Studio, select Open Existing Android Studio Project and select the build.gradle file.
  • You may need to provide the path to your local gradle installation. You can select the gradle binary inside your Android Studio installation directory.
  • You can now run the app normally from within Android Studio, or use gradlew build from the command line.

If you prefer to use your local gradle installation to generate the gradle wrapper, typegradle wrapper from the project directory.

iOS

  • Check out code from GitHub and go to a sample subfolder under ios-sender with a Podfile.
  • Run pod install in the sample folder with the Podfile (don't have Cocoapods? Learn more at https://developers.google.com/ios/cocoapods).
  • Follow the instructions from running pod install to open the project.

Chrome

  • Try out the Chrome samples hosted here:
  • Check out code from GitHub and go to a sample folder under chrome-sender with index.html.
  • Every Chrome sample has a bin subfolder with a compiled version ready to be served by a web server.
  • Every Chrome sample exposes global functions and a global gameManagerClient object to let you experiment with the Game Manager API using the Chrome devtools console.
  • If you want to modify and build your own version, you can use Closure Tools, or stub out the goog.* method calls and concatenate the js files into a single file called all.js.

Receiver

  • Check out code from GitHub and go to a sample folder under receiver with index.html.
  • Every receiver sample has a bin subfolder with a compiled version ready to be served by a web server.
  • Every receiver sample exposes a global game object that includes a debugUi field to let you call game.debugUi.open() to open the Game Manager Debug UI. You can do this programmatically or using the Chrome Remote Debugger.
  • The global game object also has a gameManager_ field that you can access in if you want to try changing the game state directly on the receiver.
  • Create a new app ID for your receiver sample using the Google Cast SDK Developer Console: https://cast.google.com/publish/
  • Update app IDs in the Android, iOS, and Chrome senders so they will launch your receiver sample and not the default public sample receiver.
  • If you want to modify and build your own version, you can use Closure Tools, or stub out the goog.* method calls and concatenate the js files into a single file called all.js.

References and How to report bugs

How to make contributions?

Please read and follow the steps in the CONTRIBUTING.md

License

See LICENSE

Terms

Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service and the Google Cast SDK Additional Developer Terms of Service.

Google+

Google Cast Developers Community on Google+ http://goo.gl/TPLDxj

gamemanagersamples's People

Contributors

bmarrdev avatar corydcode avatar ltc avatar norulesjustfeels avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.