drenayaz commited on
Commit
10c600e
·
1 Parent(s): 4f5f261

add sit policy

Browse files
app/src/game/controls/gamepad.js CHANGED
@@ -8,7 +8,8 @@
8
  // camera code). R3 toggles the chase cam.
9
  // A ground pick: one-shot pick-up-from-the-ground cycle
10
  // (runtime-faithful; game gates it to walk mode)
11
- // X roll (crouch-glide in roller mode - game decides)
 
12
  // Y HEAD mode toggle (runtime-faithful). While the game sets
13
  // `headMode`, locomotion is parked and BOTH sticks drive
14
  // the head instead: left = head pitch/yaw, right = neck
@@ -164,7 +165,7 @@ export class GamepadSource {
164
  prev.a = a;
165
 
166
  const x = !!gp.buttons[BTN_X]?.pressed;
167
- if (x && !prev.x) this.onAction("roll");
168
  prev.x = x;
169
 
170
  const y = !!gp.buttons[BTN_Y]?.pressed;
 
8
  // camera code). R3 toggles the chase cam.
9
  // A ground pick: one-shot pick-up-from-the-ground cycle
10
  // (runtime-faithful; game gates it to walk mode)
11
+ // X sit <-> stand (crouch-glide in roller mode - game decides).
12
+ // The pad can no longer launch a roll at all.
13
  // Y HEAD mode toggle (runtime-faithful). While the game sets
14
  // `headMode`, locomotion is parked and BOTH sticks drive
15
  // the head instead: left = head pitch/yaw, right = neck
 
165
  prev.a = a;
166
 
167
  const x = !!gp.buttons[BTN_X]?.pressed;
168
+ if (x && !prev.x) this.onAction("sitToggle");
169
  prev.x = x;
170
 
171
  const y = !!gp.buttons[BTN_Y]?.pressed;
app/src/game/controls/keyboard.js CHANGED
@@ -13,11 +13,13 @@ const KEYMAP = {
13
 
14
  // One-shot keys -> controller actions. Physical Q/E (A/E on AZERTY) are the
15
  // explicit left / right kicks, mirroring the pad's LB / RB; F alternates.
 
 
16
  const ACTION_KEYS = {
17
  KeyC: "chaseToggle",
18
  KeyG: "groundPick",
19
  KeyM: "locoToggle",
20
- KeyR: "roll",
21
  KeyQ: "kickL",
22
  KeyE: "kickR",
23
  KeyF: "alternateKick",
 
13
 
14
  // One-shot keys -> controller actions. Physical Q/E (A/E on AZERTY) are the
15
  // explicit left / right kicks, mirroring the pad's LB / RB; F alternates.
16
+ // R sits (crouch-glide in roller mode - the game decides, same way the
17
+ // roll action used to). Nothing dispatches "roll" any more.
18
  const ACTION_KEYS = {
19
  KeyC: "chaseToggle",
20
  KeyG: "groundPick",
21
  KeyM: "locoToggle",
22
+ KeyR: "sitToggle",
23
  KeyQ: "kickL",
24
  KeyE: "kickR",
25
  KeyF: "alternateKick",
app/src/game/game.js CHANGED
@@ -1577,8 +1577,10 @@ async function boot({ scene, camera, renderer }) {
1577
  kbKickFoot = kbKickFoot === "left" ? "right" : "left";
1578
  }
1579
  });
1580
- controller.on("sitToggle", () => {
1581
- if (loco !== "legs") return; // sitting is a legs-only skill
 
 
1582
  const sitting = mode === "sitstand" && sitFlag === 1;
1583
  setMode(sitting ? "walk" : "sit");
1584
  });
 
1577
  kbKickFoot = kbKickFoot === "left" ? "right" : "left";
1578
  }
1579
  });
1580
+ // Sit is the legs-only skill; on rollers the same button hands over to
1581
+ // the crouch-glide, exactly as the (now unbound) roll action did.
1582
+ controller.on("sitToggle", ({ source } = {}) => {
1583
+ if (loco !== "legs") return triggerCrouch(srcTag(source));
1584
  const sitting = mode === "sitstand" && sitFlag === 1;
1585
  setMode(sitting ? "walk" : "sit");
1586
  });
app/src/ui/TitleMenu.jsx CHANGED
@@ -53,7 +53,7 @@ const TILES = {
53
  kb: [
54
  { caps: "cluster-arrows", name: "Move", hint: "arrows or ZQSD" },
55
  { caps: ["A", "E"], name: "Kick", hint: "left / right" },
56
- { caps: ["R"], name: "Roll", hint: "barrel roll" },
57
  { caps: ["G"], name: "Pick up", hint: "beak to the ground" },
58
  { caps: ["C"], name: "Camera", hint: "toggle chase" },
59
  { caps: ["Space"], name: "Reset", hint: "fresh start" },
@@ -61,10 +61,9 @@ const TILES = {
61
  pad: [
62
  { caps: ["LS"], name: "Move", hint: "left stick" },
63
  { caps: ["LB", "RB"], name: "Kick", hint: "left / right" },
64
- { caps: ["X"], name: "Roll", hint: "barrel roll" },
65
  { caps: ["Y"], name: "Head", hint: "sticks move the head" },
66
  { caps: ["RS"], name: "Camera", hint: "orbit" },
67
- { caps: ["\u2193"], name: "Sit", hint: "tap again to stand" },
68
  ],
69
  touch: [
70
  { caps: ["Stick"], name: "Move", hint: "left thumb" },
 
53
  kb: [
54
  { caps: "cluster-arrows", name: "Move", hint: "arrows or ZQSD" },
55
  { caps: ["A", "E"], name: "Kick", hint: "left / right" },
56
+ { caps: ["R"], name: "Sit", hint: "tap again to stand" },
57
  { caps: ["G"], name: "Pick up", hint: "beak to the ground" },
58
  { caps: ["C"], name: "Camera", hint: "toggle chase" },
59
  { caps: ["Space"], name: "Reset", hint: "fresh start" },
 
61
  pad: [
62
  { caps: ["LS"], name: "Move", hint: "left stick" },
63
  { caps: ["LB", "RB"], name: "Kick", hint: "left / right" },
 
64
  { caps: ["Y"], name: "Head", hint: "sticks move the head" },
65
  { caps: ["RS"], name: "Camera", hint: "orbit" },
66
+ { caps: ["X", "\u2193"], name: "Sit", hint: "tap again to stand" },
67
  ],
68
  touch: [
69
  { caps: ["Stick"], name: "Move", hint: "left thumb" },