# Objects, bricks and scripts

A game is also a folder of files (rooms, things, scripts, bricks) that the eggox command line pulls and pushes, so it can be worked on from your own machine, in

A game is also a folder of files (rooms, things, scripts, bricks) that the
eggox command line pulls and pushes, so it can be worked on from your own
machine, in your own git, by any editor or an AI agent: see
[A game as files](/project/folder).

The Studio has the shape other game engines share. A room's HIERARCHY lists
its objects: the GAME (the rules), the ROOM (its settings and its script
files), and the THINGS standing in it, grouped under their ITEM (a stock mint:
what is set on the item holds for every instance of it, like a prefab). The
INSPECTOR shows the selected object's bricks (components) and its script.

Bricks on the game: `rounds`, `winner`, `teams`, `lives`, `score`, `welcome`.
No `rounds` makes a hangout. Bricks on a thing or an item: `spawn`, `goal`,
`pickup`, `hazard`, `finish`, `door`, `sign`, `switch`, and `action` (a trigger
with a verb). The Studio writes one engine from them into the room script's
block between `-- <studio>` and `-- </studio>`: waiting, countdown, the round
clock on the HUD, the winner, results, the next round. Do not edit the block;
the next save rewrites it.

A script ON a thing is Lua like the room's, in its own block. It goes on the
item (the stock mint), so it runs for every instance of it, in every room of
the game; a placed instance carries bricks of its own but no script of its
own. Its `on("click")`, `on("walk_on")` and `on("walk_off")` fire for that
thing alone; other events fire as usual. `self.item` names the item. Plain (global) functions and tables from the
room's files are shared with scripts on things; `local` names are not. The
`thing` argument carries `item`, the item id of the thing, so a room script can
tell instances of one item apart from another.
