# How Studio games work

> What the Studio turns a project into - the same JavaScript game package as a game written in code.

When you press Play or Publish, the Studio turns your project into an
ordinary game package. Rooms run it like any other game.

- The same project always gives the same files.
- Play runs exactly what Publish uploads.

## A row becomes code

_When a disc crosses Goal, add 1 to score_ becomes:

```text
// When A disc crosses Goal any
function row1(e) {
  let line = e.crossing;
  let disc = e.object;
  if (!(e.crossing === objects.Goal)) return;
  vars.score = rt.add(vars.score, 1);
}

game.on("crossing", rt.handler((e) => {
  rt.run(row1, e, "doc:5");
}));
```

- The trigger becomes `game.on`.
- Its slots become a check at the top.
- Each action becomes a line.
- `rt` is a small helper shipped with the game: variables, timers, waits, UI.

## What is in the package

| File                              | Holds                          |
| --------------------------------- | ------------------------------ |
| `game.js`                         | The entry point                |
| `runtime/*.js`                    | The shared helper              |
| `declarations.js`, `variables.js` | Enumerations, roles, variables |
| `scene.js`, `prefabs.js`          | Your scenes and prefabs        |
| `events.js`                       | Your rows                      |
| `ui.js`                           | The Menu and HUD               |
| `scripts/*.js`                    | Your scripts, as written       |
| `assets/*`                        | Images and sounds              |

Want to keep going in code? See [Studio or code?](/studio/studio-or-code).
