Merge Move and slide into Move with a 'Collide with solids' toggle
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
6ecb20cf02
commit
b0860ca07f
5 files changed
+24
-34
No files matched your search
+2
-2
@@ -582,7 +582,7 @@ try {
|
||||
await sleep(200);
|
||||
|
||||
// 15b. Solid vs trigger. Put the blue crate 150 to the right of the red one (both 100 wide →
|
||||
// 50 of free travel) and hold ArrowRight: the Mover's "Move and slide" parks the red
|
||||
// 50 of free travel) and hold ArrowRight: the Mover's Move (Collide with solids) parks the red
|
||||
// crate flush against the blue one at world x = −100. Making the blue collider a
|
||||
// trigger lets it pass through instead (the collider is then drawn amber).
|
||||
const holdRight = async (ms) => {
|
||||
@@ -607,7 +607,7 @@ try {
|
||||
return w.entities.find((e) => e.objectId === 'o1');
|
||||
};
|
||||
const blocked = await playAgainstBlue(false);
|
||||
check('Move and slide stops the red crate flush against the blue crate\'s solid collider', blocked && Math.abs(blocked.x - -100) < 0.01, `world x=${blocked?.x}`);
|
||||
check('Move with "Collide with solids" stops the red crate flush against the blue crate\'s solid collider', blocked && Math.abs(blocked.x - -100) < 0.01, `world x=${blocked?.x}`);
|
||||
const passed = await playAgainstBlue(true);
|
||||
check('a trigger collider does not block (the crate passes through)', passed && passed.x > -100 + 20, `world x=${passed?.x}`);
|
||||
await evaluate(`__gm.state.select({ kind: 'object', objectId: 'oc2' })`);
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ if (!projectId) {
|
||||
* "Mover" behavior in five nodes: every frame, move the owner along the normalized arrow-key
|
||||
* axis, scaled by the `speed` variable per second (On update's dt feeds the dt input).
|
||||
* Diagonals are not faster than straight moves because Axis input normalizes the vector, and
|
||||
* "Move and slide" stops the owner's solid colliders at other solid colliders.
|
||||
* Move's "Collide with solids" stops the owner's solid colliders at other solid colliders.
|
||||
*/
|
||||
const moverGraph = {
|
||||
nodes: [
|
||||
@@ -22,7 +22,7 @@ const moverGraph = {
|
||||
{ id: 'n-owner', type: 'Owner', x: 0, y: 120, params: {} },
|
||||
{ id: 'n-axis', type: 'AxisInput', x: 0, y: 200, params: {} },
|
||||
{ id: 'n-speed', type: 'GetVariable', x: 0, y: 400, params: { variable: 'speed' } },
|
||||
{ id: 'n-move', type: 'MoveAndSlide', x: 340, y: 0, params: {} },
|
||||
{ id: 'n-move', type: 'Move', x: 340, y: 0, params: { collide: true } },
|
||||
],
|
||||
edges: [
|
||||
{ id: 'e1', from: { node: 'n-update', port: 'exec' }, to: { node: 'n-move', port: 'exec' } },
|
||||
|
||||
Reference in new issue
Block a user