Build games on Eggox
A game is rooms, things, bricks and Lua scripts. Build it in the Studio inside Eggox, or as files on your own machine with the eggox command line. Hand the files to an AI agent; every page here is also markdown.
npm install -g @eggox/cli
eggox login
eggox pull "My Game"
No npm? curl -fsSL https://eggox.net/cli/install.sh | sh
Get started
A game on Eggox is rooms, things, bricks and scripts. Build it in the Studio, or as files on your own machine.
A game as files
eggox.json, a folder per room, a file per thing. Nothing in a game lives outside this shape.
Command line
Install the eggox command line, log in, and take your games to your own machine.
Studio
The in-game editor: a hierarchy on the left, the world in the middle, the inspector on the right.
Scripting API
Every event and verb a room script can use, on the current API version.
Get started
- What a game is A game on Eggox is rooms, things, bricks and scripts. Build it in the Studio, or as files on your own machine.
- Your first game A coin rush in ten minutes, with bricks and no code.
- With an AI agent Give an agent the docs and a folder. It pulls, writes, checks until it compiles, pushes. You play.
A game as files
- The folder eggox.json, a folder per room, a file per thing. Nothing in a game lives outside this shape.
- Rooms room.json holds a room's settings, its rules, and every thing standing in it.
- Things A thing's script and bricks live in things/, and apply to every one of it in every room.
- Stock A game holds a stock of mints; its rooms place them by name.
- Check, push, publish A push makes the game match the folder, whole or not at all. Publishing is a separate step.
Command line
- Overview Install the eggox command line, log in, and take your games to your own machine.
- eggox login Log in to Eggox from this machine. A browser opens once.
- eggox logout Forget the login on this machine.
- eggox whoami Who is logged in, and on which server.
- eggox games The games you own, with their id, rooms, API version and whether they are published.
- eggox pull A game as files, into a folder on your machine.
- eggox check Would these files work? Nothing is written; errors come back as file and line.
- eggox push Make the game match the files, whole or not at all. The game becomes the draft.
- eggox publish Publish the game as it stands. From then on the door leads here.
- eggox bag The mints in your bag, the things a game can hold.
- eggox stock The things a game holds. Put a mint in from the bag, or take one back.
- eggox docs The reference as markdown, in the terminal or into an agent.
- eggox mcp Serve the commands to an AI agent as MCP tools over stdio.
- eggox update Fetch the newest eggox from the server you use.
Studio
- The Studio The in-game editor: a hierarchy on the left, the world in the middle, the inspector on the right.
- Bricks Every brick, its fields and what it does. Bricks on the game make the rules; bricks on things make behaviour.
Scripting API
- Scripting API Every event and verb a room script can use, on the current API version.
- 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
- Build, playtest, publish Buy an experience in the Shop, place its door, and open its setup panel.
- Runtime and state Scripts execute on the server in Luerl, an Erlang implementation of Lua.
- Room events Event Handler arguments and meaning --- --- start function() once when the copy starts, before players enter enter function(player) when someone joins leave fu
- Scene and players Call Effect or return value --- --- things() All things in the copy, including hidden stock named(name) Things with that exact name, as an array at(x, y) Thing
- Windows and responsive layouts window(player, spec) opens or replaces one window for that player.
- Readouts and messages Call Purpose --- --- say(text) / say(player, text) Brief line for everyone / one player panel(title, rows) / panel(player, title, rows) HUD with {{"SCORE", 3},
- Timers after(seconds, tag) runs once.
- Saved progress and leaderboards Call Purpose --- --- save(player, key, value) / load(player, key) Personal progress in this game save(key, value) / load(key) Shared values for this game save(
- Rooms, copies and invitations Call Purpose --- --- send(player, roomName) Enter a copy of another room in this game send({p1, p2}, roomName, true[, tag]) Start a fresh copy for these player
- Lua library and limits Useful library functions include pairs, ipairs, type, tonumber, tostring, assert, error, pcall, math, table, and string.
- Thing scripts The server-owned interactive-furniture API also accepts a smaller script type.
- Implementation and examples The API is implemented in server/lib/eggox/scripts/runtime.ex; window validation is in server/lib/eggox/scripts/window_spec.ex.
- Costumes, combat feedback and interactive readouts An experience can temporarily dress a player using native artwork in that room (visible placements or hidden stock).
- Public and private copies send(player, "Room", "private"[, tag]) finds or creates that player's personal copy.
- Real reward shops inside experiences Place a normal player stall in an authored room to sell real items that stay in the buyer's inventory outside the experience.