Games, rooms and players
What a disko game is, what a room does, and how players, the owner and spectators relate to both.
A game is a package of JavaScript modules and assets. It describes the world (discs, walls, goals), the rules (what happens when a ball crosses a line) and the interface (the Menu and the HUD). The same package runs everywhere: in the Studio's Play tab, in a test room on your machine and in public rooms.
A room runs one game for a group of people. The room host loads the package, keeps the authoritative state and sends every player what they need to draw it. Players never run the rules themselves, so nobody can change the score by editing their own browser.
People in a room are players. A player is either in the match, controlling a body such as a disc, or watching as a spectator. The room owner is the person who opened the room; the game decides what the owner, and anyone else, may do through roles.
A match is the part of a room's life where the world exists: it starts, can pause and resume, and stops. Between matches the room still runs the game, so the Menu works and players can pick teams, but there are no discs.
In the Studio, the event sheet's Match and Players triggers follow this
life: The match starts, A player joins the room, A player enters the
match. In code, the same moments are game.on("start"),
game.on("player-join") and game.on("player-enter").