Skip to main content

window.Totem

window.Totem is frozen. Do not replace it or add properties.

gameOver({ score })

Call this once when a run ends.
An invalid score is ignored and writes a console warning. A valid call records a game_over event and asks the Totem shell to submit the score for the current player. The shell can reject a score above the game’s configured maximum or more than one score from the same player and game within ten seconds. The game-over screen still keeps Play again available.

event(name, props)

Record a game-specific custom event.
props must be JSON-serializable. One event payload can be at most 2,048 bytes. Do not include secrets or direct personal information.

Safe fallback

This lets the same build run outside a Totem play page.