# The editor

    doorbench [PROJECT]

A game is a folder of files. The editor shows them as places, screens, tables, functions
and scripts; everything is one undo away, and only files that changed are written.

TUTORIAL.md makes a first game, without script.

## Views

| | |
|---|---|
| Flow | The places. Green is the start, orange has nothing leading to it, red has an error or no way out. Dashed lines are handlers that move the player |
| The game | Its name, players, turns, and what happens on arriving, each day and so on |
| Fields | What each player, and the world, has |
| Place | Screen or text, what happens on arriving, and the choices. Each handler is blocks or script; **Convert to script** goes one way (and can be undone) |
| Screen | 80 by 24. Tools along the top, colours and characters on the right. Live fields show values; drag them with the first tool |
| Table | Fields and, for a fixed table, rows, with CSV in and out. A row's number and a field's id never change, so saved games stay right |
| Script | Ctrl+Space offers names. The language is in SCRIPT.md |
| Guides | `player`, `sysop` and `licence` go into the packages |
| Find | All files. Right-click a thing in the tree to rename it everywhere, find its uses or delete it |
| Test play | The real engine on a game that is thrown away: up to four players, values to look at and change, stops at a line, the next day, line speeds, hanging up |
| Balance | Simulated players; see SIM.md |

Problems are listed below and lead to where they are; a block with one has a red border.

## Cut, copy and paste

| Where | Keys | Right-click |
|---|---|---|
| Any box | Ctrl+X, Ctrl+C, Ctrl+V, Ctrl+A; or Shift+Delete, Ctrl+Insert, Shift+Insert | Cut, Copy, Paste, Select All (also in **Edit**) |
| Test play | Drag or double-click, then Ctrl+C or Ctrl+Insert. Ctrl+V or Shift+Insert types into the game | Copy, Paste, Select All |
| Screen, Select tool | The same keys on the block selected. A block copied here keeps its colours; text from elsewhere takes the pen's | Cut, Copy, Paste, Select All |
| Screen, Text tool | Ctrl+V puts text at the cursor, a line to a row | Paste |

## Blocks

A change that other players could make too (the world, shared tables, other players) is
made all-or-nothing by itself. To make several things happen together, put them in **All or
nothing**; nothing in it may show or ask anything. **Spend** tests and takes in one.

## Without a window

    doorbench check PROJECT
    doorbench build PROJECT [-o FILE] [-release]
    doorbench test PROJECT
    doorbench sim PROJECT [options]
    doorbench package PROJECT [-o FOLDER] [-systems dos,linux,windows]

## Packages

**Game > Make packages** makes a ZIP for each system: the engine under the game's name, the
game, guides, licences, the engine's source, FILE_ID.DIZ and a daily script. It refuses a game
with errors, or without a version, author and licence. Each ZIP is read back, and the one for
this computer is unpacked, set up and started.
