Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

submitScore

submitScore<Options>(authority, handle, player, score, submitScoreOptions?): ScoreSubmitResult

Submits player’s score to a board a room writes, in the room’s step: it waits with the player’s record and rides the next checkpoint’s commit, so the score and the progress that earned it land together. Coalesced per board, key and period by the board’s rule; stamped with the period of the tick, or of a delta’s id. A score of the wrong shape, or metadata its schema refuses, throws in development; a score the board cannot take is refused, logged and answered. The same delta id adds once.

Type Parameter
Options extends LeaderboardOptions & object
Parameter Type
authority Authority
handle LeaderboardHandle<Options>
player PlayerEntity
score LeaderboardScore<Options>
submitScoreOptions SubmitScoreOptions<Options>

ScoreSubmitResult

submitScore(step, leaderboards.fastestLap.for("sunset-loop"), player, 71400);
submitScore(step, leaderboards.coinsFound, player, { delta: 12, id });