Furniture collision, cafe chairs/stools, and sit spot animations#1
Furniture collision, cafe chairs/stools, and sit spot animations#1
Conversation
Add obstacle collision detection (circle + AABB shapes) for all three rooms so creatures can't walk through tables, bars, and couches. Cafe environment now has chairs around tables, bar stools, and 3 couch seats with per-spot animations (eat at tables, idle at bar, rest on couch). Sitting creatures use the sit spot's Y position for elevated surfaces. Also adds start/stop convenience scripts in tools/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review FindingsH1 — Server-side obstacle collision causes rubber-banding on sit-walk M1 — L1 — No validation test for room obstacle data All three fixed in follow-up commit. |
Server was applying obstacle collision on player:move, causing rubber-banding when creatures walked to sit spots inside obstacle zones (e.g. chairs inside table collision circles). Server now only enforces bounds clamping — obstacle collision is a client UX concern. Also: set executable bit on tools scripts, add obstacle data validation test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `satisfies` on ROOMS preserves narrow literal types, so rooms without `animation` on sit spots exclude it from the union. Explicitly typing roomConfig as RoomConfig widens to the SitSpot interface which has `animation?`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review FindingsL1 — Fixed in follow-up commit. |
Server no longer calls clampAndResolve after the rubber-banding fix. Updated file header and JSDoc to reflect client-only usage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
animationfield (eat at tables, idle at bar, rest on couch). Sit spots use Y position for elevated surfaces (couch at Y=0.2). Couch has 3 seats instead of 1.tools/start.shandtools/stop.shfor launching/stopping the full dev stack.Files changed
room.ts(obstacle types, sit spot animation field)collision.ts+collision.test.ts(new)rooms.ts(13 cafe sit spots, obstacle arrays for all rooms),rooms.test.tsCreature.tsx,RemoteCreature.tsx(collision, sit Y + animation)ClickPlane.tsx(obstacles prop, clampAndResolve)CozyCafe.tsx(Chair, BarStool components),RooftopGarden.tsx,StarlightLounge.tsxconnectionHandler.ts(server-side collision validation)tools/start.sh,tools/stop.shTest plan
pnpm test— 402 tests passing (36 files)🤖 Generated with Claude Code