RoundStatus
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
countdownLeft |
number |
Seconds of its countdown left. |
elapsed |
number |
Simulated seconds it has played. |
fail |
(reason) => void |
Loses a round that has not ended, for reason. On a page in a room, throws in development and does nothing outside it, as finish does; a system on the room calls failRound. |
finish |
() => void |
Wins a round in play. On a page in a room, throws in development and does nothing outside it: the room decides the round, so a page sends a command and a system on the room calls finishRound. |
lap |
number |
Laps finished. |
laps |
number |
The laps that win it; 0 for none. |
reason |
string |
Why it was lost: "time", or the reason passed to fail. |
restart |
() => void |
Starts its scene again, so the coins, the player and the round spawn anew. On a page in a room, asks the room, which, once its round is won or lost, starts its own scene again, so every page gets the new round; the players keep their characters. |
score |
number |
The coins addCoins credited while it played, a pickup’s among them; a spend lowers it no more than a wallet a save restored raises it. |
secondsLeft |
number |
Simulated seconds the round has left, never below zero; Infinity with no limit. |
start |
() => void |
Starts a round that is ready. On a page in a room, asks the room, which starts its round where it is ready and refuses otherwise. |
state |
RoundState |
Where the round stands. |
target |
number |
The score that wins the round; 0 for none. |