From 10c600e54ea52f239887308387cb8fc458ecb3e4 Mon Sep 17 00:00:00 2001 From: drenayaz Date: Thu, 27 Aug 2026 12:17:38 +0200 Subject: [PATCH] add sit policy --- app/src/game/controls/gamepad.js | 5 +++-- app/src/game/controls/keyboard.js | 4 +++- app/src/game/game.js | 6 ++++-- app/src/ui/TitleMenu.jsx | 5 ++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/game/controls/gamepad.js b/app/src/game/controls/gamepad.js index 132c4c1..ab8d113 100644 --- a/app/src/game/controls/gamepad.js +++ b/app/src/game/controls/gamepad.js @@ -8,7 +8,8 @@ // camera code). R3 toggles the chase cam. // A ground pick: one-shot pick-up-from-the-ground cycle // (runtime-faithful; game gates it to walk mode) -// X roll (crouch-glide in roller mode - game decides) +// X sit <-> stand (crouch-glide in roller mode - game decides). +// The pad can no longer launch a roll at all. // Y HEAD mode toggle (runtime-faithful). While the game sets // `headMode`, locomotion is parked and BOTH sticks drive // the head instead: left = head pitch/yaw, right = neck @@ -164,7 +165,7 @@ export class GamepadSource { prev.a = a; const x = !!gp.buttons[BTN_X]?.pressed; - if (x && !prev.x) this.onAction("roll"); + if (x && !prev.x) this.onAction("sitToggle"); prev.x = x; const y = !!gp.buttons[BTN_Y]?.pressed; diff --git a/app/src/game/controls/keyboard.js b/app/src/game/controls/keyboard.js index c7496ab..5bd7623 100644 --- a/app/src/game/controls/keyboard.js +++ b/app/src/game/controls/keyboard.js @@ -13,11 +13,13 @@ const KEYMAP = { // One-shot keys -> controller actions. Physical Q/E (A/E on AZERTY) are the // explicit left / right kicks, mirroring the pad's LB / RB; F alternates. +// R sits (crouch-glide in roller mode - the game decides, same way the +// roll action used to). Nothing dispatches "roll" any more. const ACTION_KEYS = { KeyC: "chaseToggle", KeyG: "groundPick", KeyM: "locoToggle", - KeyR: "roll", + KeyR: "sitToggle", KeyQ: "kickL", KeyE: "kickR", KeyF: "alternateKick", diff --git a/app/src/game/game.js b/app/src/game/game.js index 94c9829..66747c1 100644 --- a/app/src/game/game.js +++ b/app/src/game/game.js @@ -1577,8 +1577,10 @@ async function boot({ scene, camera, renderer }) { kbKickFoot = kbKickFoot === "left" ? "right" : "left"; } }); - controller.on("sitToggle", () => { - if (loco !== "legs") return; // sitting is a legs-only skill + // Sit is the legs-only skill; on rollers the same button hands over to + // the crouch-glide, exactly as the (now unbound) roll action did. + controller.on("sitToggle", ({ source } = {}) => { + if (loco !== "legs") return triggerCrouch(srcTag(source)); const sitting = mode === "sitstand" && sitFlag === 1; setMode(sitting ? "walk" : "sit"); }); diff --git a/app/src/ui/TitleMenu.jsx b/app/src/ui/TitleMenu.jsx index 54bd22a..0f345fc 100644 --- a/app/src/ui/TitleMenu.jsx +++ b/app/src/ui/TitleMenu.jsx @@ -53,7 +53,7 @@ const TILES = { kb: [ { caps: "cluster-arrows", name: "Move", hint: "arrows or ZQSD" }, { caps: ["A", "E"], name: "Kick", hint: "left / right" }, - { caps: ["R"], name: "Roll", hint: "barrel roll" }, + { caps: ["R"], name: "Sit", hint: "tap again to stand" }, { caps: ["G"], name: "Pick up", hint: "beak to the ground" }, { caps: ["C"], name: "Camera", hint: "toggle chase" }, { caps: ["Space"], name: "Reset", hint: "fresh start" }, @@ -61,10 +61,9 @@ const TILES = { pad: [ { caps: ["LS"], name: "Move", hint: "left stick" }, { caps: ["LB", "RB"], name: "Kick", hint: "left / right" }, - { caps: ["X"], name: "Roll", hint: "barrel roll" }, { caps: ["Y"], name: "Head", hint: "sticks move the head" }, { caps: ["RS"], name: "Camera", hint: "orbit" }, - { caps: ["\u2193"], name: "Sit", hint: "tap again to stand" }, + { caps: ["X", "\u2193"], name: "Sit", hint: "tap again to stand" }, ], touch: [ { caps: ["Stick"], name: "Move", hint: "left thumb" },