Commit Graph

2 Commits

Author SHA1 Message Date
type-two
ed1c3af17a feat(mobile): touch controls + portrait camera — BLOBBO is playable on a phone
The game shipped to a public web arcade with ZERO touch input: on a phone you
could tap PLAY and then nothing moved. Fixes that, and the framing bug it
exposed.

- src/blob/touch.ts: a third input source beside keyboard and gamepad. Floating
  thumbstick in the lower-left (touch anywhere in the zone and THAT point is the
  stick centre — forgiving on a screen with no tactile edges) plus a JUMP button
  lower-right. Emits the same {x,z,jump} shape the gamepad poll produces, so the
  controller consumes all three sources through one path (including the same
  buffered jump edge). Installs NOTHING on a non-touch device, so desktop gets no
  phantom UI. Hidden until ui:play so it can't sit behind the title card.
  `?touch=1` forces it on to preview the phone layout from a desktop.
- index.html: touch-action:none — the browser otherwise claims drags on the game
  surface for scroll/pull-to-refresh, so steering panned the page.
- camera: FOV is VERTICAL, so a portrait phone saw ~30 degrees horizontally vs
  ~92 on 16:9 — the blob filled the screen and the course was invisible. Pull the
  rig back on narrow aspects (no fisheye), recomputed per frame so rotating the
  device adapts. Exactly 1.0 at 16:9 and wider, so desktop is untouched.
- world.ts: clamp the viewport to >=1px. A zero-height container made aspect
  0/0 = NaN and poisoned the projection matrix (blank screen healed only by a
  later resize); mobile browsers genuinely report 0 during orientation changes
  and address-bar collapse.

Verified with synthetic TouchEvents at 375x812: stick drag-up drives vz -8.47,
byte-identical to keyboard W under the same settled camera; JUMP takes vy 0 to
6.85 and the blob rises; nub/ring track the drag; layer hidden pre-play, shown
post-play. Desktop at 1280x800 keeps base distance 9 / height 4.5 with no touch
layer. tsc + 10 test suites green.

ponytail: tried two portrait composition refinements (flatter rig, aim-ahead
lead) and reverted BOTH — each traded floor for sky and framed less course than
the plain pulled-back rig. Noted in-file so nobody re-derives them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 22:49:49 +10:00
type-two
4b08ba65ac Lane A: blob controller, feel layer, follow camera, greybox
- src/blob/createBlob.ts: rotation-locked dynamic ball + clean UV-sphere body
  mesh (untouched UVs for Lane B) + cosmetic eyes; implements frozen Blob.
- src/blob/controller.ts: fixed-step System. Camera-relative WASD via impulses,
  buffered+coyote jump, grounded raycast, emits blob:jumped/blob:landed. Reads
  blob.modifiers every frame: speedMul, jumpMul, massMul, grip, size.
- src/blob/feel.ts: the comedy engine. Underdamped springs for landing squash,
  jump stretch, inertial jelly lean, idle breathing + run bob; base-pivoted so
  squash plants on the floor. Driven by the frozen wire events. glow -> emissive.
- src/blob/camera.ts: soft-follow third-person cam with position lag, yaw ease
  behind travel, and FOV kick at speed.
- src/course/greybox.ts: Breakfast Rush greybox — start plateau, ramp, gap jump,
  slope, translucent milk river (surface:water), machine drop area, finish pad.
- src/demo/lane-a.ts: boots world+greybox+blob, HUD + once/sec state log, debug
  keys 1/2/3 (speed/jump/size) plus 4/5/6 (mass/grip/glow), 0 reset, R respawn.

npm run build passes (tsc strict + vite). Owned paths only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:11:55 +10:00