Examples

Here are some example events and challenges that should help you determine what to do in your game. These are intended to be representative only.

Flappy Bird

Here is the simplist of our examples since there is really only one thing to do. Get as far as possible without crashing.

Parameter Definitions

key: "score"
type: "numeric"

Event

This simple event only includes 1 parameter, the player’s score. This event should be sent each time a player crashes and the Game Over menu is shown to the player. In this example the player got a score of 15.

(Check with you platform specific docs for the syntax to submit an event)

{
  "score": 15
}

Challenge Definition

This challenge will allow players to compete for the best score in Flappy Bird.

"title":"Best Score",
"parameter":"score",
"function":"maximum"

Kart Racing

Here is an example of everyones favorite Kart Racing game with plumbers, mushrooms, & turtles. In this type of game there are multiple parameters that will be sent at the end of each race as a single event.

Parameter Definitions

Time - The total time it took for the player to complete the race, in seconds.

key: "time"
type: "numeric"

Place - The position that the player finished the race in (1st, 2nd,…).

key: "place"
type: "numeric"

Character - The name of the character that was used for the race.

key: "character"
type: "string"

Powerups - The number of powerups collected in the race.

key: "powerups"
type: "numeric"

Event

Here is an example of the event that would be sumbitted at the end of a race.

{
  "time": 157.2,
  "place": 2,
  "character": "princess",
  "powerups": 5
}

Challenge Definitions

Because the events have more than one parameter it is possible to create multiple challenge definitions for our Kart game. This allows player to choose which type of challenge they want to create.

This challenge allows players to see who can get fastest time.

"title":"Best Time",
"parameter":"time",
"function":"minimum"

This challenge allows players to see who can collect the most powerups in a single race.

"title":"Most Powerups",
"parameter":"powerups",
"function":"maximum"

First Person Shooter

In this example we will look at a traditional FPS game.

Parameter Definitions

Kills - The total number of kills by the player in the match.

key: "kills"
type: "numeric"

Kill Streak - The longest kill streak by the player in the match.

key: "killstreak"
type: "numeric"

Headshot Kills - The total number of headshot kills by the player in the match.

key: "headshots"
type: "numeric"

Flags - The number of times the player scored a point in a Capture the Flag match.

key: "flags"
type: "numeric"

Event

Here is an example of the event that would be sumbitted when a match has completed.

{
  "kills": 11,
  "killstreak": 2,
  "headshots": 3,
  "flags": 0
}

Challenge Definitions

In this case it is possible to create a challenge definition for each parameter creating 4 different challenge definitions. You can create multiple challenge definitions that use the same parameter as long as the function is different between the definitions.

This challenge allows players to see who can gets the most number of kills in a single match.

"title":"Most Kills In A Match",
"parameter":"kills",
"function":"maximum"

You can also use the total function to compute a score across multiple events. In this case we will compute the total number of headshots for the entire duration of the challenge. These types are challenge can be very powerful since they encourage your players to play many times instead of just trying to get the best single score possible.

"title":"Total Headshots",
"parameter":"headshots",
"function":"total"

Need Another Example

If you think we are missing a specific example, reach out to us or feel free to submit a PR to these docs!