# 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.

```mermaid alt="You publish a game to the registry; a room loads a release from the registry; players join the room from their browsers."
flowchart TB
  you["You"] -- publish --> registry[("Registry")]
  registry -- load a release --> room["Room"]
  room <-- play --> players["Players' browsers"]
```

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](/concepts/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")`.
