Skip to content

[5/16] feat: add weighted walking and running - #122

Merged
arudaev merged 5 commits into
chore/34-collision-loaderfrom
feature/27-walk-and-run
Oct 24, 2026
Merged

arudaev merged 5 commits into
chore/34-collision-loaderfrom
feature/27-walk-and-run

Conversation

@Vatsal2005

@Vatsal2005 Vatsal2005 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

The hero walks at 150.5 px/s and accelerates to 258 px/s after holding a direction for 0.4 seconds. Short acceleration and braking give the poncho weight; reversal resets the run timer and changes facing. A/D, arrows, gamepad stick and D-pad share the controller. The 28×76 body uses authored flat ground and solid walls; F2 shows measured speed and position. Jump, slope policies, ladders and animation switching follow in their assigned issues.

Issue

Closes #27

Stack

Base: chore/34-collision-loader. Human merges bottom up; retarget the next PR to main and merge origin/main into every open branch, never rebase.

Acceptance criteria

  • 3.5 m/s walking, 6 m/s running after 0.4s held
  • Short acceleration and deceleration; release and reversal reset the run timer
  • Faces movement; keyboard and gamepad stick/D-pad mappings implemented

Verification

  • Node 22: npm run typecheck, npm test (62 tests), npm run build; includes main integration at e8577ab
  • py -3.13 scripts/check_docs.py — 594 files
  • git diff --cached --check
  • Pure tests cover timing, acceleration/braking, reversal, analog dead zone, opposing inputs, D-pad priority, frame rates, flat floor and swept wall contacts
  • Browser keyboard: A/D and arrows move, face and stop correctly; debug measured 150.5 px/s (3.50 m/s) for short hold and 258.0 px/s (6.00 m/s) for long hold; feet stay on the Garden floor; no console errors
  • Physical gamepad playthrough: mapping logic is tested, hardware verification remains
  • Vercel preview: GitHub states Vatsal2005 needs project access on Vercel to create deployments. A project owner must grant access; local checks pass.

Screenshots

Shown in chat and saved in ignored tmp/verification/27-walk.png and 27-run.png. GitHub's browser is signed out, so uploading through that UI is unavailable.

Use the documented walk and run speeds with short acceleration, braking and a direction-sensitive run delay. Keep input normalization testable across keyboard, stick and D-pad controls.

Place the hero on authored flat ground and solid boxes, with a feet-origin body and an F2 speed readout for tuning and review. Jump, slopes and animation switching remain separate stories.
@Vatsal2005 Vatsal2005 self-assigned this Oct 23, 2026
@Vatsal2005
Vatsal2005 requested a review from arudaev October 23, 2026 21:39
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wincs Error Error Oct 24, 2026 12:28am UTC

Request Review

@vercel

vercel Bot commented Oct 23, 2026

Copy link
Copy Markdown

@Vatsal2005 must be a member of the arudaev's projects team on Vercel to deploy.
- Click here to add @Vatsal2005 to the team.
- If you initiated this build, request access.
- If you're already a member of the arudaev's projects team, make sure that your Vercel account is connected to your GitHub account.

Learn more about collaboration on Vercel and other options here.

@github-actions github-actions Bot added the area:player Hero movement, animation state, camera label Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/5] feat: add weighted walking and running [5/6] feat: add weighted walking and running Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/6] feat: add weighted walking and running [5/7] feat: add weighted walking and running Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/7] feat: add weighted walking and running [5/8] feat: add weighted walking and running Oct 23, 2026
Carry the reviewed lane B foundation and latest human-merged integration upward without rewriting published history.
@arudaev
arudaev added this pull request to stack #129 October 23, 2026 22:12
@Vatsal2005 Vatsal2005 changed the title [5/8] feat: add weighted walking and running [5/9] feat: add weighted walking and running Oct 23, 2026
@arudaev

arudaev commented Oct 23, 2026

Copy link
Copy Markdown
Member

Review from lane A (Alexander asked for everything to match the approved art before merging). Physics, collision, slopes, ladders, camera and the 70 tests are good – one gap blocks the merge:

The hero never animates on the ground. Player.update falls back to setTexture('hero-move', 'idle-00') for every grounded state, so walking and running slide a still frame. The approved, exported atlases already carry the clips (game/public/assets/sprites/*.anims.json, {frames, fps, loop} per clip):

  • hero-move: idle 6 · idle-walk 2 (no loop) · walk 8
  • hero-run: walk-run · run-start · run
  • hero-idle: look-around · check-tablet · check-wounds (optional: after a few idle seconds)
  • hero-air: jump · fall · hard-landing (you already pick these frames by hand – could be the same clips)

Please, on this stack:

  1. Register the clips once from the .anims.json (frame names <clip>-NN, fps/loop from the file) – e.g. in stage/assets.ts after the atlas loads.
  2. In Player.update, play by state: standing → idle; start moving → idle-walk then walk; above walk speed → walk-run/run-start then run; air/ladder/landing as now. Use sprite.play(key, true) so a running clip isn't restarted every frame.
  3. A Vitest for the state → clip choice (pure function), like the jump tests.

FYI: F2 stays yours (debug readout) – lane A moved the pocket computer's dev key to F4 (#128). The failing check on every layer is only Vercel blocking previews for commits by authors outside the Vercel team, not the build.

@Vatsal2005 Vatsal2005 changed the title [5/9] feat: add weighted walking and running [5/10] feat: add weighted walking and running Oct 23, 2026
Carry human-merged lane A changes upward without rewriting published commits.
@Vatsal2005 Vatsal2005 changed the title [5/10] feat: add weighted walking and running [5/11] feat: add weighted walking and running Oct 23, 2026
Carry human-merged lane A changes upward without rewriting published commits.
@Vatsal2005 Vatsal2005 changed the title [5/11] feat: add weighted walking and running [5/12] feat: add weighted walking and running Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/12] feat: add weighted walking and running [5/13] feat: add weighted walking and running Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/13] feat: add weighted walking and running [5/14] feat: add weighted walking and running Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [5/14] feat: add weighted walking and running [5/15] feat: add weighted walking and running Oct 24, 2026
@Vatsal2005 Vatsal2005 changed the title [5/15] feat: add weighted walking and running [5/16] feat: add weighted walking and running Oct 24, 2026
Carry human-merged lane A changes upward without rewriting published commits.
@arudaev
arudaev marked this pull request as ready for review October 24, 2026 01:34
@arudaev
arudaev merged commit 2cb1f6d into main Oct 24, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:player Hero movement, animation state, camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M1-S1] Walk and run with weight

2 participants