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 <noreply@anthropic.com>
This commit is contained in:
1 parent
4900d7bbf6
commit
76aa441dce
33 files changed
+1905
-301
No files matched your search
+6
-22
@@ -5,15 +5,12 @@
|
||||
* from tools/seed-demo.mjs so the shipped demo can change without rewriting 100+ checks; the
|
||||
* fixture's objects are uniquely named and positioned exactly where the checks expect them.
|
||||
*
|
||||
* Usage: PATH=/opt/node22/bin:$PATH node tools/seed-e2e.mjs <projectId> [baseUrl]
|
||||
* Run tools/seed-demo.mjs afterwards to put the demo project back.
|
||||
* Usage: PATH=/opt/node22/bin:$PATH node tools/seed-e2e.mjs [projectId] [baseUrl]
|
||||
* Defaults to the dedicated fixture project; the demo project is refused.
|
||||
*/
|
||||
const projectId = process.argv[2];
|
||||
const baseUrl = process.argv[3] ?? 'https://nockal.com/game-maker/';
|
||||
if (!projectId) {
|
||||
console.error('usage: node tools/seed-e2e.mjs <projectId> [baseUrl]');
|
||||
process.exit(2);
|
||||
}
|
||||
import { PROJECTS, cliArgs, writeProject } from './projects.mjs';
|
||||
|
||||
const { projectId, baseUrl } = cliArgs('seed-e2e.mjs', PROJECTS.fixture);
|
||||
|
||||
/**
|
||||
* "Mover" behavior in five nodes: every frame, move the owner along the normalized arrow-key
|
||||
@@ -93,17 +90,4 @@ const project = {
|
||||
],
|
||||
};
|
||||
|
||||
const url = `${baseUrl}api/index.php?r=projects/${projectId}`;
|
||||
const current = await fetch(url);
|
||||
if (!current.ok) {
|
||||
console.error(`GET failed: ${current.status}`);
|
||||
process.exit(1);
|
||||
}
|
||||
const { revision } = await current.json();
|
||||
const res = await fetch(url, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ revision, project }) });
|
||||
const body = await res.json();
|
||||
if (!res.ok) {
|
||||
console.error('PUT failed', res.status, body);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`seeded ${projectId} → revision ${body.revision}`);
|
||||
await writeProject(projectId, baseUrl, project);
|
||||
Reference in new issue
Block a user