Skip to content

[12/16] feat: add alternating chair sweeps and contact hits - #137

Merged
arudaev merged 4 commits into
feature/42-health-and-respawnfrom
feature/39-chair-sweeps
Oct 24, 2026
Merged

arudaev merged 4 commits into
feature/42-health-and-respawnfrom
feature/39-chair-sweeps

Conversation

@Vatsal2005

@Vatsal2005 Vatsal2005 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Tap J or gamepad X/Square for alternating eight-frame chair sweeps, each ending in two recoil frames. Only the inspected A04/B03 contact poses enable the short hitbox, with one attempt per target per swing. Accepted hits add a 60ms stage hit-stop, a small spark, hit sound and target knockback. A single queued tap keeps the return swing responsive; damage, death and climbing cancel it. The game uses the approved atlas without scaling its poses.

Issue

Closes #39

Refs #50

Stack

Base: feature/42-health-and-respawn. Human merges bottom up; retarget the next PR to main and merge origin/main into every open branch, never rebase.

Acceptance criteria

  • Alternate sweep A/B and finish each with the two-frame recoil

  • Contact-only hitboxes; 60ms hit-stop, spark and target knockback

  • Light impact with the supplied recoil poses

Verification

  • Node 22: npm run typecheck, npm test (99 tests), npm run build; includes main integration at e8577ab

  • py -3.13 scripts/check_docs.py — 703 files

  • git diff --cached --check

  • Tests cover exact pose windows, eight-plus-two timing, queued alternation, both directions, one attempt per target and exactly 60ms pause across partial frames

  • Browser: stationary rover test target records A then B hits, followed by a third hit from the opposite side; target is pushed in the strike direction; F2 shows the contact box and hit-stop; no console errors

  • Browser: a 5ms keyboard tap is retained through Phaser's release flag

  • Physical gamepad and Vercel preview: Vatsal2005 needs Vercel project access to create deployments

Integration and art timing

Stage.chair.register(target) accepts damageable actors; real rover AI follows in #45. Stage.playerActor exposes the player and Stage.chair.enabled gates the weapon for lane A's pickup beat in #50. Engine testing enables the chair in Rusty Creek and leaves it disabled in the Garden.

The approved B contact pose points the opposite way from A. Runtime mirrors B relative to the locked strike direction so both hit the frontal target; recoil uses its own right-facing pose. Contact indices were checked against the actual exported frames. A development-only combat-test query adds the stationary rover fixture and hit counter; it never appears in production.

Reference comparison

Plan and measurements: docs/02 — chair contact.

Native contact poses against the 25px rover baseline

Reproduce: python scripts/compare.py lineup chair-side:sweep-a-04 chair-side:sweep-b-03 enemy-rover:idle-00 --out game/verification/39-chair-contact-compare.png.

The reference comparison found the original 50px envelope too long. Contact now reaches 8–33px forward, 23–58px above the foot pivot. The fixture uses its measured 31×25px bounds, starting 38.5px ahead so the second sweep still overlaps after 8px of fixture knockback. Exact bounds, both directions and rejection beyond reach are tested.

Browser after correction: two stationary A/B strikes, then a third left-facing strike connect; the return contact shows 60ms hit-stop. A 5ms tap remains responsive. Screenshots shown in chat, with originals in ignored tmp/verification/39-measured-two-hits.png and 39-measured-left-hit.png. No browser console errors. The comparison is committed as review evidence; source art is unchanged.

Alternate the approved side sweeps through their recoil poses and expose short hitboxes only at the inspected contact frames. Keep one hit attempt per target and one buffered return swing.

Freeze stage actors for 60 milliseconds on an accepted strike, play the hit sound and spark, and let targets apply knockback. Add a development rover fixture and preserve very short keyboard taps through release flags.
@Vatsal2005 Vatsal2005 self-assigned this Oct 23, 2026
@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.

@Vatsal2005
Vatsal2005 requested a review from arudaev October 23, 2026 23:01
@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:32am UTC

Request Review

@github-actions github-actions Bot added area:player Hero movement, animation state, camera area:combat Chair, guard, health, damage, save points, pickups labels Oct 23, 2026
@Vatsal2005
Vatsal2005 added this pull request to stack #129 October 23, 2026 23:16
Carry human-merged lane A changes upward without rewriting published commits.
Record the contact plan and native atlas measurements in the design. Limit the contact envelope to 8–33 pixels in front of the hero and keep the rover fixture within both alternating sweeps after knockback.

Add a baseline comparison and regression coverage for exact bounds on both sides. Typecheck, 99 tests, build and documentation checks pass; browser strikes connect in both directions.
@github-actions github-actions Bot added the area:docs Design docs, README, contributor guides label Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [12/12] feat: add alternating chair sweeps and contact hits [12/13] feat: add alternating chair sweeps and contact hits Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [12/13] feat: add alternating chair sweeps and contact hits [12/14] feat: add alternating chair sweeps and contact hits Oct 23, 2026
@Vatsal2005 Vatsal2005 changed the title [12/14] feat: add alternating chair sweeps and contact hits [12/15] feat: add alternating chair sweeps and contact hits Oct 24, 2026
@Vatsal2005 Vatsal2005 changed the title [12/15] feat: add alternating chair sweeps and contact hits [12/16] feat: add alternating chair sweeps and contact hits 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:combat Chair, guard, health, damage, save points, pickups area:docs Design docs, README, contributor guides area:player Hero movement, animation state, camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M2-S1] Swing the chair: alternating sweeps with a slight recoil

2 participants