add sit policy
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user