Skip to content

Instantly share code, notes, and snippets.

View postScore.js
score=<playerScore> -- Needs to always be called score but it could represent anything. Whatever is being counted by the event.
&eventname=<leaderboardEventName> -- The name of the event that is attached to the leaderboard.
View retrieveleaderboard.js
aroundme=true& -- Return scores above and below current user. Omit if you want the top of the leaderboard.
leaderboardname=<shotnameofleaderboard>& -- Name of the leaderboard.
entrycount=<number of entries>& -- How many entries to return. If aroundMe is included in the call this number will be the records returned above and below the user otherwise this will be the total number of records.
username=<player user name>& -- Username of player.
password=<player password> -- Password of player.
View saveandload.js
//Get url:<apiKey>/savePlayerTable/<credential secret>?username=<username>&password=<user password>&tablename=<table name>
//Save url:<apiKey>/getPlayerTable/<credential secret>?username=<username>&password=<user password>&tablename=<table name>
//Get Code
var uPwd = Spark.getData().password;
var uName = Spark.getData().username;
var uTableName = Spark.getData().tablename;
View registerlogin.js
//Login URL:
//Register URL:
//The login code:
var uPwd = Spark.getData().password;