Editor offset, global On click, Coin container in the jump-and-run seed
- SceneObject.editorOffset (x/y): shifts only where an object is drawn in the Scene tab, cascades to children, undo-able with a reset action. Never written into container templates. - On click without an owner now fires for any click inside the camera frame instead of hit-testing the (editor-only) behavior symbol. - seed-jumprun: coins are a "Coin" container (sprite + trigger), nested containers are expanded recursively, Destroy targets the coin's parent, and the clock uses a Ceil node instead of ToText. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2511483a67
commit
3234eb480f
14 files changed
+229
-53
No files matched your search
@@ -84,8 +84,11 @@ export class BehaviorSystem implements System {
|
||||
}
|
||||
}
|
||||
this.fireCollisions(instance, i, ctx);
|
||||
// With an owner the click has to land on it; a behavior without one has no shape to
|
||||
// be hit, so it listens to the whole game view (anywhere inside the camera frame).
|
||||
const pointer = world.pointer;
|
||||
if (pointer.pressed && world.hitTest(instance.entity.parent ?? instance.entity, pointer.x, pointer.y)) {
|
||||
const owner = instance.entity.parent;
|
||||
if (pointer.pressed && (owner ? world.hitTest(owner, pointer.x, pointer.y) : pointer.inside)) {
|
||||
i.fire('OnClick', ctx, { x: pointer.x, y: pointer.y });
|
||||
}
|
||||
i.fire('OnUpdate', ctx, { dt });
|
||||
|
||||
Reference in new issue
Block a user