Coder Social home page Coder Social logo

amzn / gameon-starter-kit-unity Goto Github PK

View Code? Open in Web Editor NEW
4.0 10.0 8.0 469 KB

With the GameOn Unity Starter Kit, Unity game developers can easily test out all the endpoints that GameOn Game API provides before even integrating them in their game client. It also provides an avenue for us to showcase best practices while calling the GameOn API.

License: Apache License 2.0

C# 100.00%

gameon-starter-kit-unity's Introduction

GameOn Unity Starter Kit

With the GameOn Unity Starter Kit, Unity game developers can easily test all the basic endpoints that GameOn Game API provides before even integrating them in their game client.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Latest verison of Unity that can be downloaded from here. This starter kit was tested using Unity 2018.3.8f1.
  • Public API key for the game registered with GameOn. Please follow the instructions here to plug in your first game to GameOn. Please note that while registering the game do not select "Enable advanced security". This starter kit will not work for such games.
  • At least one ongoing competition for the game that you registered above. You can create one from GameOn Console as shown here. If it is your first competition, then you can create it with the default values. Just ensure that competition starts now so that you can see it while running the application.

Setup

  • Download or git clone this repository.

  • Launch Unity, click Open, navigate to the folder where you downloaded the repository and select "gameon-starter-kit-unity" folder.

  • Inside Unity, select "File > Open Scene", navigate to "gameon-starter-kit-unity" folder, and choose "Assets > GameOn > GameOnTest.unity".

  • Select "GameOn" game object under the "GameOnTest" scene and you're ready to run the application.

    .github/images/gameon-game-object-selected-in-unity.png

Run

  • Click the "Play" button at the top to start
  • Enter the public API key for your game (see Prerequisites)
  • Ignore the "Existing Player Token" field for now. We'll revisit it later.
  • Click on "Register New Player" button. This is equivalent of Register Player operation in GameOn API.
  • Once you see "Player Token" field populated under "Current Player Info" section, proceed further.
  • Enter "Player Name". This is optional and if you don't provide it, GameOn will create one for you.
  • Click the "Authenticate Player" button. This corresponds to Authenticate Player operation in GameOn API.
  • Please see the value for "Session Expiration Date". At this time, session will expire and you will have to authenticate this player again. That's where "Player Token" field comes into picture. If you have player token saved somewhere, you can then next time when you run the kit, you can skip "Register Player" by entering "Player Token" and directly proceed for "Authenticate Player".
  • At this point, if you have ongoing competitions, you should see them when you click "Get Tournament List" button. Please refer to this for more details about the "Get Tournaments" operation.
  • Against each tournament that showed up, you will see "Enter Tournament" button. Clicking on this will enter the player that you just authenticated into that tournament. Behind the scene, GameOn finds an open match and enters the player into it. This is considered the first attempt for the player. Details about "Enter Tournament" operation can be found here.
  • Once entered successfully, you can submit score for this player by clicking "Submit Score" button against the tournament. You can find more information about "Submit Score" operation here.
  • On successful score submission, kit calls "Get Leaderboard" operation automatically to get the top 10 scores in the match. This operation support multiple options like finding the rank of the player, getting the top n neighbors etc. For more details, please click here
  • To have player submit score again for the same match, click on "Enter Match" button. This operation allows players to make more than one attempt in a match. For more information, please see this.

This covers all the basic operations that GameOn API provides. For the comprehensive list of operations, please consult the API reference.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This library is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

gameon-starter-kit-unity's People

Contributors

abhaywit avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.