SurfCam

Play Subway Surfers with your body: step between lanes, jump and duck on camera, jog in place all you want

not yet reviewed by publik

How to install SurfCam

Every step written out, for people who have never opened a terminal. Pick the setup you have.

SurfCam

Webcam pose controller + HUD wrapped around the official Subway Surfers web build on Poki. The game is not modified or copied. An Electron window hosts poki.com in a webview, runs MediaPipe Pose on your webcam in the host page, draws a HUD over the game, and fires arrow keys into the game through Electron's trusted input API.

Run

cd ~/surfcam && npm start

Zero engine installs. Node + npm only. Camera permission is asked once.

Play

  1. Stand back so the camera sees at least your hips. Feet visible gives the strongest jump detection.
  2. Click the game once (or press the Focus game button / f) so Unity has keyboard focus.
  3. Step left / right to change lane. The HUD strip shows which of the three camera zones you are in.
  4. Jump to jump. Crouch to roll under barriers. Jogging in place does nothing.

Game only (default ON) hides everything on the Poki page except the game iframe and pins it to the full window. It is one injected stylesheet: every element visibility: hidden, #game-element visible and position: fixed; inset: 0. Nothing is reparented, so the game never reloads. Toggle it off if you need Poki's own UI. Fullscreen takes the whole app fullscreen (Esc exits).

HUD buttons: Keys: ON/OFF (or k) pauses key sending so you can use the mouse on Poki's UI. Recenter lane (or c) tells the controller the character is back in the centre lane.

How detection works (renderer/pose-logic.mjs, tested by npm test)

  • Every vertical measure is divided by torso length, so distance from the camera does not matter.
  • Jump = both ankles rise past a rolling-median baseline in the same frame AND hips rise. Jogging alternates feet, so it never satisfies this. With ankles out of frame it falls back to hips + nose rising together.
  • Duck = nose drops well below its 4 s rolling baseline. Jogging bounces it a little, a crouch drops it a lot.
  • Lanes = mirrored hip-centre x in three bands with hysteresis so a boundary never flaps.

Swapping the output

KeystrokeOutput in renderer/app.js is the only thing that knows about Poki. Replace it with a direct binding once the game is ours; the controller emits lane / jump / duck intents only.

Verification hooks

  • SURFCAM_STATUS=/path/status.json npm start writes live tracking state twice a second.
  • SURFCAM_PROBE=1 npm start injects a keydown counter into the game iframe, fires a test key, and logs what the game frame received.