O'Reilly logo

Practical Game Design with Unity and Playmaker by Sergey Mohov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Kongregate API code

There are two scripts that we are going to have to make in order to get our Wins scoring parameter saved and appearing in the leaderboards. The first one will set up Kongregate, make sure that the game is indeed on the Kongregate page, and inform the game about the API connection status.

The second script is going to be about incrementing a score for the player who wins based on the goal the puck hits.

Without any further delay, the following is the code for the handshake script, which is called KongregateAPI:

using UnityEngine; using System.Collections; // You have to add System in order to access the Convert class using System; public class KongregateAPI : MonoBehaviour { // We are going to check this variable to confirm ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required