SDK
Scores, leaderboards and tournaments
Scores are checked on our server, so the boards stay honest.
Runs and scores
A run starts at gameplayStart() and ends at gameOver() or win(). It is timed on our server, so your game never sends or sees a start time. A run is flagged, saved, and never ranked or rewarded if it is shorter than 3 seconds, above the maximum score we set for your game, or climbs faster than the per-second limit we set. score(), lives() and level() are live hints for display only.
Leaderboards
Boards rank each player's best accepted run (ties go to whoever got there first). We set per game whether a higher score or a lower one (a race time) wins; report a time as the plain number. Boards cover all time, this week and today. After each accepted run the player sees their rank on screen, and the game's page shows the top scores.
// One line: VPlay draws its own board over your game, pauses and resumes it.
if (VPlay.feature("leaderboard")) trophyButton.onclick = () => VPlay.showLeaderboard();
// A game that draws its own board (a capability we switch on per game):
const board = await VPlay.leaderboard({ scope: "week", limit: 10 }); // null if unavailable
// A tournament banner:
if (VPlay.tournament) banner.textContent = VPlay.tournament.title;Tournaments
A tournament is a named period with its own board and a prize list in VCoins, which we pay out after review. While one is running for your game, VPlay.tournament holds its title, start, end and top prize, and the tournament leaderboard scope ranks it.
