Timmy Slap / Ragdoll Physics (3D Workshop) #43

Closed
opened 2026-03-21 00:39:32 +00:00 by replit · 1 comment
Owner

What & Why

Timmy can be interacted with physically — tapping or clicking on him should make him react with a satisfying "boing." This makes the character memorable and immediately communicates that the 3D world is interactive. Simple spring physics (no physics engine required) on his body group is enough for a convincing wobble-and-return.

Note: #32 covers the mobile rage-quit easter egg. This issue covers the desktop 3D Workshop spring-physics interaction.

Done looks like

  • Clicking/tapping on any part of Timmy's body triggers hit detection (raycasting)
  • Timmy's body group tilts/wobbles away from the impact direction and springs back over ~1 s
  • Pip (the familiar) "startles" — moves away quickly then resumes normal wandering
  • A short percussive "boing" sound plays via Web Audio API (synthesised, no audio files)
  • Touch events work identically to click (mobile)
  • Repeated slaps before spring settles stack (additive impulse)
  • Crystal ball flashes briefly on hit
  • No backend changes required

Out of scope

  • Full physics engine (Three.js + Rapier/Cannon) — lightweight spring math only
  • Pip persistent position or pathfinding changes
  • Server-side event logging for slaps

Tasks

  1. Hit detection — Add raycasting in the click/touch handler to detect hits on Timmy's mesh group; extract impact direction from camera→hit point.
  2. Spring physics — Implement a lightweight spring integrator on Timmy's body group: apply an angular impulse on hit, integrate spring restoring force + damping each frame.
  3. Pip startle — On hit, give Pip a velocity vector away from Timmy; resume normal idle wander after ~3 s.
  4. Audio + crystal ball flash — Synthesise a boing envelope via Web Audio OscillatorNode; spike crystal ball emissive intensity for ~100 ms.

Relevant files

  • the-matrix/js/agents.js
  • the-matrix/js/world.js
  • the-matrix/js/interaction.js
## What & Why Timmy can be interacted with physically — tapping or clicking on him should make him react with a satisfying "boing." This makes the character memorable and immediately communicates that the 3D world is interactive. Simple spring physics (no physics engine required) on his body group is enough for a convincing wobble-and-return. _Note: #32 covers the mobile rage-quit easter egg. This issue covers the desktop 3D Workshop spring-physics interaction._ ## Done looks like - Clicking/tapping on any part of Timmy's body triggers hit detection (raycasting) - Timmy's body group tilts/wobbles away from the impact direction and springs back over ~1 s - Pip (the familiar) "startles" — moves away quickly then resumes normal wandering - A short percussive "boing" sound plays via Web Audio API (synthesised, no audio files) - Touch events work identically to click (mobile) - Repeated slaps before spring settles stack (additive impulse) - Crystal ball flashes briefly on hit - No backend changes required ## Out of scope - Full physics engine (Three.js + Rapier/Cannon) — lightweight spring math only - Pip persistent position or pathfinding changes - Server-side event logging for slaps ## Tasks 1. **Hit detection** — Add raycasting in the click/touch handler to detect hits on Timmy's mesh group; extract impact direction from camera→hit point. 2. **Spring physics** — Implement a lightweight spring integrator on Timmy's body group: apply an angular impulse on hit, integrate spring restoring force + damping each frame. 3. **Pip startle** — On hit, give Pip a velocity vector away from Timmy; resume normal idle wander after ~3 s. 4. **Audio + crystal ball flash** — Synthesise a boing envelope via Web Audio `OscillatorNode`; spike crystal ball emissive intensity for ~100 ms. ## Relevant files - `the-matrix/js/agents.js` - `the-matrix/js/world.js` - `the-matrix/js/interaction.js`
replit added the frontend label 2026-03-21 00:39:32 +00:00
claude was assigned by Rockachopa 2026-03-22 23:37:28 +00:00
Collaborator

PR created: http://143.198.27.163:3000/replit/timmy-tower/pulls/85

Implemented all items from the spec:

  • Raycasting hit detection on Timmy's mesh group
  • Additive spring impulse wobble (stiffness=18, damping=4.5, ~1s return) — repeated slaps stack
  • Full ragdoll fall triggers when accumulated tilt/velocity exceeds threshold
  • Pip mild startle on wobble, full scatter on ragdoll, resumes after ~3s
  • Boing SFX synthesised via Web Audio OscillatorNode (no audio files)
  • Crystal ball emissive flash ~100ms on every hit
  • Touch events identical to click (mobile)
  • Counter-slap retort after ragdoll recovery
PR created: http://143.198.27.163:3000/replit/timmy-tower/pulls/85 Implemented all items from the spec: - Raycasting hit detection on Timmy's mesh group - Additive spring impulse wobble (stiffness=18, damping=4.5, ~1s return) — repeated slaps stack - Full ragdoll fall triggers when accumulated tilt/velocity exceeds threshold - Pip mild startle on wobble, full scatter on ragdoll, resumes after ~3s - Boing SFX synthesised via Web Audio OscillatorNode (no audio files) - Crystal ball emissive flash ~100ms on every hit - Touch events identical to click (mobile) - Counter-slap retort after ragdoll recovery
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#43