From 76aa441dcee873b1ae58550809850975dc0af4e3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 7 Sep 2026 20:52:10 +0200 Subject: [PATCH] Enabled switch, text assets, mouse input and the jump-and-run example game Engine additions that the example game needed: - `enabled` as a shared property of every placeable asset (default on, an override on the scene object). A switched-off object is not drawn, does not collide and its behavior does not run - and neither does anything parented below it. Disabled objects are now hidden in the scene view as well, so the editor shows what the game shows; they stay in the hierarchy panel, which is where they are selected and switched back on. - Asset type `text` (text, fontSize, color, align), rendered in scene and game. - Pointer input in the game view: `On click`, `Mouse position`, `Mouse button`, `Is hovered`, hit-tested against colliders, else sprite/text footprints. - New nodes: Set/Is enabled, Set text, Is asset, Name of, Equals, To text, Join text, Floor/Ceil/Round, Modulo, Random, Time, Restart game. Tooling: shared CDP harness (tools/harness.mjs), central project registry with a guard that keeps destructive scripts off the playground (tools/projects.mjs), plus smoke suites for the demo scene and the jump-and-run game. Co-Authored-By: Claude Opus 5 --- README.md | 79 ++++- src/core/commands/assetCommands.ts | 2 + src/core/commands/variableCommands.ts | 5 +- src/core/graph/NodeRegistry.ts | 30 ++ src/core/graph/nodes.ts | 196 +++++++++++- src/core/model/Asset.ts | 10 +- src/core/model/AssetTypes.ts | 2 +- src/core/properties/PropertySchema.ts | 34 ++- src/core/properties/bounds.ts | 61 ++++ src/core/properties/collider.ts | 6 + src/core/properties/enabled.ts | 26 ++ src/core/store/serialize.ts | 7 +- src/editor/App.ts | 12 +- src/editor/panels/AssetPanel.ts | 4 +- src/editor/panels/Inspector.ts | 107 ++++--- src/runtime/World.ts | 55 +++- src/runtime/systems/BehaviorSystem.ts | 21 +- src/runtime/systems/CollisionSystem.ts | 10 +- src/viewport/Viewport.ts | 119 ++++++-- tests/core/commands.test.ts | 2 +- tests/core/enabled.test.ts | 295 ++++++++++++++++++ tests/core/graph.test.ts | 13 +- tests/core/hierarchy.test.ts | 6 +- tests/core/resolve.test.ts | 6 +- tests/core/serialize.test.ts | 2 +- tools/e2e.mjs | 204 ++++--------- tools/harness.mjs | 144 +++++++++ tools/projects.mjs | 58 ++++ tools/seed-demo.mjs | 28 +- tools/seed-e2e.mjs | 28 +- tools/seed-jumprun.mjs | 408 +++++++++++++++++++++++++ tools/smoke-demo.mjs | 101 ++++++ tools/smoke-jumprun.mjs | 125 ++++++++ 33 files changed, 1905 insertions(+), 301 deletions(-) create mode 100644 src/core/properties/bounds.ts create mode 100644 src/core/properties/enabled.ts create mode 100644 tests/core/enabled.test.ts create mode 100644 tools/harness.mjs create mode 100644 tools/projects.mjs create mode 100644 tools/seed-jumprun.mjs create mode 100644 tools/smoke-demo.mjs create mode 100644 tools/smoke-jumprun.mjs diff --git a/README.md b/README.md index adf49f94..6221da63 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ Live: · Widget playground: