From bbe381e1145940a21ef1daae6a8d6ae5d23e7b57 Mon Sep 17 00:00:00 2001 From: tfrere Date: Thu, 20 Aug 2026 14:29:07 +0200 Subject: [PATCH] feat: kickable ball (B / pad Y) and detachable chase camera (C) Ball: a light free sphere injected into the MJCF after the robot body (keyframe qpos grown 21 -> 28, ball parked 50 m away by default). B or gamepad Y pops/respawns it ~0.35 m in front of the duck with a small jitter; a watchdog teleports it back when it rolls past the grid fade (3 m); R re-parks it. Rendered as a procedural beach ball, local-only (not shared with multiplayer ghosts). Camera: chase mode on by default eases the camera behind the duck's heading at the current orbit distance (wheel zoom preserved); dragging detaches back to free orbit-follow, C toggles chase back on. HUD keycaps, welcome modal and README updated; cache-buster bumped to 26. Co-authored-by: Cursor --- README.md | 6 ++ index.html | 7 +- rl.js | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 193 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7fb9779..7742383 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,15 @@ and [apirrone/mjlab_microduck](https://github.com/apirrone/mjlab_microduck). - A / E: strafe - Space: roll (one barrel roll, then back to running) - F: kick, alternating feet +- B: pop / respawn a kickable ball in front of the duck +- C: toggle the chase camera (on by default; dragging detaches it) - R: reset - Drag to orbit, scroll to zoom - Colour dots: repaint the duck (it quacks) +The ball is local-only: it lives in your tab's physics and is not shared +with the multiplayer ghosts. + ### Gamepad Plug in a controller and the same mapping as the real robot runtime applies: @@ -44,6 +49,7 @@ Plug in a controller and the same mapping as the real robot runtime applies: - Left stick: forward / back + strafe - Right stick: turn - X: roll +- Y: pop / respawn the ball - RB / LB: right / left kick - D-pad down: sit / stand toggle - Right trigger: mouth (analog) + quack diff --git a/index.html b/index.html index 5430ac9..b638458 100644 --- a/index.html +++ b/index.html @@ -393,10 +393,13 @@ AE strafe
Space roll   F kick   + B ball   + C camera   R reset   drag to orbit · scroll to zoom
gamepad: X roll   + Y ball   RBLB kick   ⇓ sit   ⇑ run   @@ -422,6 +425,8 @@
  • MoveArrows or ZQSD to run and turn, A / E to strafe, drag to orbit.
  • RollSpace triggers a barrel roll, then it gets back up.
  • KickF throws a kick, alternating feet (RB / LB on the pad).
  • +
  • BallB pops a ball to kick around (Y on the pad).
  • +
  • CameraFollows from behind; drag to break free, C re-attaches.
  • GamepadPlug one in - same mapping as the real robot.
  • GhostsOther visitors right now appear as translucent ducks, live.
  • @@ -471,7 +476,7 @@ appended: a plain src attribute can 401 when the browser blocks the *.static.hf.space auth cookie inside the hub iframe. -->