From 6cc4cc6f20b2fdbb568fc3009d4ec9056ed809c5 Mon Sep 17 00:00:00 2001
From: tfrere
Date: Thu, 20 Aug 2026 16:15:10 +0200
Subject: [PATCH] feat: simpler controls, post-kick grace, arena walls, true
soccer texture
- Remap controls: left stick / A-D turn (strafe removed), Q/E kick
left/right, R rolls, Space resets; HUD, welcome modal and README
updated to match.
- Hold commands at zero for 20 control steps after a kick ends so the
duck finishes the strike cleanly instead of instantly sprinting.
- Rebuild the ball texture per pixel as a spherical Voronoi over the 32
truncated-icosahedron panel centers: large flat-edged black pentagons
with thin seams and no pole special case.
- Enclose the play area in a 3x3 m arena of static box walls rendered
with the floor's grid shader; the respawn watchdog now only fires if
the ball somehow escapes the arena.
Co-authored-by: Cursor
---
README.md | 16 ++-
index.html | 17 ++-
rl.js | 309 +++++++++++++++++++++++++++++++++++++++--------------
3 files changed, 244 insertions(+), 98 deletions(-)
diff --git a/README.md b/README.md
index 7742383..02ab331 100644
--- a/README.md
+++ b/README.md
@@ -28,26 +28,24 @@ and [apirrone/mjlab_microduck](https://github.com/apirrone/mjlab_microduck).
## Controls
-- Arrow up / down: forward / back
-- Arrow left / right: turn
-- A / E: strafe
-- Space: roll (one barrel roll, then back to running)
-- F: kick, alternating feet
+- Arrows or WASD (ZQSD): forward / back + turn
+- Q / E (A / E on AZERTY): kick left / right
+- R: roll (one barrel roll, then back to running)
- B: pop / respawn a kickable ball in front of the duck
- C: toggle the chase camera (on by default; dragging detaches it)
-- R: reset
+- Space: 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.
+with the multiplayer ghosts. A square arena (3 x 3 m) fences the play
+area so neither the ball nor the duck can wander off.
### Gamepad
Plug in a controller and the same mapping as the real robot runtime applies:
-- Left stick: forward / back + strafe
-- Right stick: turn
+- Left stick: forward / back + turn
- X: roll
- Y: pop / respawn the ball
- RB / LB: right / left kick
diff --git a/index.html b/index.html
index 2adc0b2..454b198 100644
--- a/index.html
+++ b/index.html
@@ -389,13 +389,12 @@
↑↓ move
- ←→ turn
- AE strafe
- Space roll
- F kick
+ ←→ turn
+ R roll
+ AE kick
B ball
C camera
- R reset
+ Space reset
drag to orbit · scroll to zoom
gamepad:
X roll
@@ -422,9 +421,9 @@
at 50 Hz. No server, no pre-baked animation.
- - 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).
+ - MoveArrows or ZQSD to run and turn, drag to orbit.
+ - RollR triggers a barrel roll, then it gets back up.
+ - KickA / E kick left / right (LB / RB 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.
@@ -476,7 +475,7 @@
appended: a plain src attribute can 401 when the browser blocks the
*.static.hf.space auth cookie inside the hub iframe. -->