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

MatchStatus

A match as a view reads it: its rules, where it stands, its scores and members, and the verbs a page sends.

Property Type Description
capacity number Its slots in all; Infinity for no cap.
countdownRemainingSeconds number Seconds of its countdown left.
elapsedSeconds number Simulated seconds it has played.
entity MatchEntity The match’s entity, which startMatch and endMatch take.
isOpen boolean Whether it takes joins.
isOvertime boolean Whether it plays its overtime.
lapEndSeconds readonly number[] The match’s seconds played as each of the reading player’s own laps counted, in order, from the race’s start, as MatchSlot reads them: elapsedSeconds less the last is the lap being driven. Empty for a page in no slot.
laps number The laps that win it; 0 for none.
lapsCompleted number Laps completed: a co-op match’s, or the reading player’s own.
lapsOwed number The laps the reading player owes a lap line for crossing it backward, which the player’s next forward crossings pay: above 0, the player crossed the line backward and has not crossed back, the warning a HUD shows. 0 for a page in no slot.
matchNumber number The contest it plays, from 1, which each reset raises.
maxScore number The score that wins it whatever its lead; 0 for none.
maxSpectators number The spectators it takes at once; 0 for none, and for a match with no queue.
mode MatchMode Who its competitors are.
name string What a directory and a sign show.
outcome MatchOutcome How it ended for the reading player, which every member shares in a co-op match; None until it ends, and for a page in no slot.
place number | null The reading player’s place, as the player’s slot reads it; null for a page in no slot.
players readonly PlayerEntity[] Its members, in slot order.
queue string | null The shared queue’s name it seats from, "" for a line of its own, null for none.
reason string Why it ended: "time" at time, "forfeit", or the reason passed to end.
remainingSeconds number Simulated seconds the match has left, never below zero; Infinity with no limit.
reset () => Promise<SettledCommandResult<CommandHandle<{ match: EntityCommandField & object; }, NotEnded | HasQueue, undefined, false, false, "reset", false, false>>> Asks the room to reset a queue-less match that ended, by step, with no reload.
restart () => Promise<SettledCommandResult<CommandHandle<{ }, NotEnded | NoScene | HasQueue, undefined, false, false, "restart", false, false>>> Asks the room to start the scene again once a queue-less match has ended, so every page gets the new match.
results readonly MatchResult[] Each member’s result, frozen at its end; empty before.
score number A co-op match’s shared score; in a match of teams or a free-for-all, the reading player’s own.
scoreToWin number The score that wins the match; 0 for none.
slots readonly MatchSlot[] Its held and taken slots.
spectators readonly PlayerEntity[] The players watching it, in the order they started.
start () => void Asks the next step to start the match where it waits, by command alone as in a room.
state MatchState Where the match stands.
teams readonly MatchSideStatus[] Each side, in a match of teams.
timeUp MatchTimeUp How it ends as its clock runs out: with MatchTimeUp.NextScore and remainingSeconds at zero, the next score decides it, as a HUD’s “next point wins” says.
winningTeam Team | null The side that won a match of teams, or null.