Add the Variable node and show the variable name in node titles
Get/Set variable nodes now title themselves "Get <name>" / "Set <name>", and
the new Variable node just "<name>"; the title is the same folded or open,
and a collapsed node shrinks to it. The redundant "Variable: <name>" row is
gone unless the variable was deleted ("<name>?" is the only hint then).
The Variable node sets its value when an exec flow arrives and exposes the
value at any time. Its output is read when a downstream node pulls it, not
frozen at the write, so count = count + 1 is one Variable node plus an Add.
Get variable keeps reading once per pulse: switching it would change the
behaviour of existing games.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f8a308d62
commit
e9fa592078
19 files changed
+354
-38
No files matched your search
@@ -99,8 +99,12 @@ shown on the node and editable in the inspector.
|
||||
|
||||
- **Variables** are the behavior's own property schema (`BehaviorAsset.variables`): they
|
||||
appear in the inspector, can be overridden per placed instance, and each running instance
|
||||
gets its own mutable copy. `Get variable` / `Set variable` read and write them, and their plurals
|
||||
`Get variables` / `Set variables` do the same for several at once: their settings are a *list* of
|
||||
gets its own mutable copy. `Get variable` / `Set variable` read and write them, and are titled
|
||||
by the variable they name (*Get speed*, *Set speed*). `Variable` is both in one node, titled by the
|
||||
variable alone: its output can be read at any time – no flow has to reach it – and is read at the
|
||||
moment it is asked, so a read after a write sees the new value; an arriving flow writes its input.
|
||||
`count = count + 1` is one `Variable` node feeding its own output through an `Add` back into its
|
||||
input. Their plurals `Get variables` / `Set variables` do the same for several at once: their settings are a *list* of
|
||||
variables, one port per entry, so reading a handful is one node instead of a column of five. Those
|
||||
ports are picked from the behavior's variables rather than named, they take their type from the
|
||||
declaration, and renaming a variable carries them (and their edges) along. A variable is a
|
||||
@@ -149,7 +153,7 @@ shown on the node and editable in the inspector.
|
||||
- **Node set** (`src/core/graph/nodes/`, one file per node): events `On start`, `On update`, `On key down/up/held`,
|
||||
`On timer`, `On collision enter/stay/exit`, `On click` (the mouse pressed on the owner – anywhere when it has none), `Start` · flow `Branch`, `Sequence`, `Repeat`, `Run behavior`, `End` · data `Self`, `Owner`, `Parent`, `Object by name`, `Name of`,
|
||||
`Is asset` (is this object an instance of asset X – how you tell what you collided with), `Get/Set
|
||||
variable`, `Get/Set variables`, `Get/Set property`, `Get position` (local and world), `Is enabled`, literals, `Add/Subtract/Multiply/Divide`,
|
||||
variable`, `Variable`, `Get/Set variables`, `Get/Set property`, `Get position` (local and world), `Is enabled`, literals, `Add/Subtract/Multiply/Divide`,
|
||||
`Min/Max/Abs/Sqrt/Clamp`, `Floor/Ceil/Round`, `Modulo`, `Random`, `Time`, `To text`, `To number`, `Join text`,
|
||||
`Substring`, `Find text`, `Equals`,
|
||||
lists `List` (a constant), `Fill` (one value repeated – how an empty board is made), `Count`,
|
||||
@@ -268,7 +272,8 @@ shown on the node and editable in the inspector.
|
||||
- **A node can be collapsed** to its title bar: the chevron in front of the title (it leaves the
|
||||
selection alone, like the hierarchy's), or right-click → *Collapse node* / *Expand node*, which
|
||||
acts on the whole selection as one undo step. Every link of one side then meets at a single
|
||||
point on the title bar, and its hidden links share one mark per side. A collapsed node has no
|
||||
point on the title bar, and its hidden links share one mark per side. It narrows to its title
|
||||
(never wider than an open node, where a long title is cut). A collapsed node has no
|
||||
ports to grab, so a link dropped on it goes nowhere – expand it to wire it. Like hiding a link,
|
||||
this is drawing only: `collapsed` on the node is saved with the project.
|
||||
- **Header bar** (the same one the Texture and Container tabs have): the behavior picker,
|
||||
@@ -644,7 +649,7 @@ npm run check # typecheck + lint + format:check + tests, what CI would ru
|
||||
# code is lost (tail's is reported), so a red run reads as green
|
||||
npm run build # writes dist/ and regenerates index.html
|
||||
export GM_REMOTE=user@host # optional: run the browser elsewhere; see below
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 537 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 542 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 – a subset while working on one step
|
||||
./e2e.sh start [GM_STEPS] # the same run detached, see below
|
||||
./e2e.sh status # live progress, or the last run's result
|
||||
|
||||
Reference in new issue
Block a user