What it does

StreamerMayhem is a basketball game for a seated Twitch streamer. Viewers play from chat. The streamer plays with their head.

Viewers type !drop 1-3 to send a ball and !pie 1-3 to throw a pie. The streamer leans left and right to move a face-tracked hoop under the balls and away from the pies.

The middle lane is a two-pointer dropped from above. The left and right lanes are three-pointers thrown in an arc. The closer the hoop is to the middle of the ball, the better the judgement. A streak of catches adds bonus points. A pie that lands costs points.

The streamer can pick the difficulty with the head: tilt to choose, nod to confirm.

The game page shows a marquee strip with viewer names and results, a streamer-versus-chat bar, the score and a grade at the end of the round. Page / is practice, where Auto drops adds waves of balls and pies. Page /live takes only viewers' commands.

Why a webcam

Viewers want to play with the streamer. I first planned whole-body dodging with Codex. In my tests, wide-frame detection was too limited, so I moved to head tracking. The camera stays on the streamer's face, so small head movements are enough. The streamer keeps reading chat and needs no keyboard or controller.

How it connects to Twitch

The game page reads a channel's chat over Twitch's IRC WebSocket. It needs no login. It is read-only and never posts. The demo video shows one continuous screen recording of real Twitch chat, typed from my own second viewer account, next to the game on a phone.

I also built a Twitch OAuth and EventSub WebSocket path. It reached the connection step only.

How I used Codex

In the main Codex thread (about 16 hours and 1,615 tool calls; the session ID is on the submission form) I designed the plan and wrote the first version of the game. That covered the shared rules core, the Twitch provider and EventSub adapter with the OAuth flow, the versioned overlay protocol and a first suite of about 170 tests. That work is the repository's first commit.

I reviewed each stage separately, using file hashes recorded at each review. Codex fixed the issues the reviews raised.

I built the basketball game on top of it afterwards with Claude Code, 28-31 Oct. It adds login-free chat, camera tracking, drop waves, sound, difficulty and the head menu. It works alongside the Codex-built core.

Limits

  • EventSub reached the connection step only. I did not verify chat delivery through it.
  • Twitch does not document reading chat without a login, so that path could stop working.
  • Bits and supporter features were tested with simulated cheers only.
  • The OBS overlay is a Browser Source, not a Twitch Extension. It shows a subset of the game page.
  • Face tracking assumes one person. I measured it on one Android phone with one person wearing glasses, at about 22 frames per second. Lighting and camera placement change accuracy.
  • The game footage in the video is a local recording, not a live broadcast.

Testing

The Node test suite has 407 tests and needs no packages. One timing test can fail when the machine is busy. It covers the rules, the drop waves, the Twitch adapter and the overlay protocol. Setup is in README.md and TWITCH_LIVE_SETUP.md. Without Twitch credentials, node scripts/serve-local.mjs runs the full game in labeled simulation mode.

Built With

Share this project:

Updates

Submission history