PUSHPLAY

Your repo

Party, phones and motion

Games played on the TV with everyone's phones, phones as extra controllers in any game, motion controls, online play and camera games.

Everyone has a phone. PushPlay lets a game use them: as a party’s controllers, as an extra controller in any game, or as a motion controller you swing and tilt. Nothing is installed on the phones; they join in their browser by scanning a QR code.

Party games

A party game runs on the TV (or a Steam Deck, PC or tablet plugged into one), and everyone plays from their phone. Players scan the QR code in the lobby, or open the address shown and type the code. Controllers plugged into the machine can join too. Think quizzes, drawing and bluffing games, cards with hidden hands, or action games with phones as gamepads. Up to 16 players.

"inputs": ["phones", "gamepad"],
"party": true,
"genres": ["party"],
"modes": ["phones"]

Party games are built on the kit’s runtime files, which carry the connection, the lobby and the QR code:

npx github:Visual-Zone-Development/pushplay-kit new-game my-party --party --controller classic --players 3-8

Phone layouts

Phones show one of the shared, tested layouts, or a phone screen of your own (--controller custom):

Layout The phone shows Made for
classic A floating stick, A B X Y, pause Most action games
pad classic with only A and B The simplest gamepad
twin Two sticks, with LT and RT Twin-stick shooters
dpad An 8-way d-pad, A and B Retro, puzzle and grid games
tap The whole screen is one button Rhythm, one-button, reaction
swipe Swipes in four directions, and a tap Snake, sliding blocks, lanes
slider One slider and A Paddles, steering, aiming
trackpad A laptop-style trackpad Point-and-click, cards, strategy
choices A prompt, a private card, answer buttons Quizzes, votes, hidden roles
motion Tilt, steering and swings Motion games (below)
camera The phone’s camera, tracking its player Phones as cameras (below)

A game can switch layouts at any time, for everyone or one player, set button labels, hide buttons and theme the pad in its own colours.

What makes a good party game

  • The TV runs the whole game. Phones show what they’re sent and send back taps. party.pad(id) reads every player the same way, phone or plugged-in controller.
  • Secrets go to one phone. party.public goes to every phone; party.view(id) to one player’s only. Never put a secret in party.public.
  • Every menu works from the phones. Nobody should have to get up and touch the TV to resume, restart or quit: the open menu is mirrored on every phone.
  • Phones drop. A locked screen or a Wi-Fi change keeps a player’s seat for two minutes; show them dimmed and skip their turn.
  • Treat what phones send as untrusted. Check its type and range before using it.
  • Delay. Through PushPlay’s relay a phone’s input takes about 50–150 ms, fine for party, quiz, card and brawler games. Where it can, a phone also opens a direct link: about 5–20 ms on the same Wi-Fi.

In PushPlay, a phone already in use as PushPlay’s remote joins the game’s party by itself when the room opens, with the same name.

Phones as controllers in any game

A game that isn’t a party game can take phones as controllers too: someone without a controller picks up their phone and plays. The game doesn’t change; each phone that joins is one more controller.

npx github:Visual-Zone-Development/pushplay-kit new-game my-game --phones
  • Show how to connect on a screen of its own, reached from the title and pause menus (“Connect a phone”): a QR code, the address and the code.
  • Open the room only when that screen is first shown, so someone playing with a controller never touches the network.
  • Read a phone exactly as a plugged-in controller, and pause when one drops.
  • Let new phones in only while the screen shows, and for half a minute after.

On the runtime files, phone-pads.js does all of this: connectPhones(input, { layout: 'pad' }) once, and every phone is a pad in input.pads. List "phones" in inputs beside the controls the game already plays with.

Motion controls

Phones know which way gravity points and how fast they’re turning. They don’t know where they are in the room or where the TV is.

Plays well Doesn’t
Tilt: a tray, a marble maze Pointing at the screen like a light gun
Steering, holding the phone like a wheel Tracking where the phone is
Swings, flicks and shakes: a bat, a racket, maracas Precise continuous aiming
Grip, swing and let go: bowling, darts, casting
npx github:Visual-Zone-Development/pushplay-kit new-game my-game --party --controller motion

Gestures are detected and timed on the phone, so timing games feel fair despite the delay. A motion game lists "phones" and "motion" in inputs, plus any other control that still makes sense (a stick can tilt a maze; nothing stands in for swinging a bat), and always offers a re-center button.

  • Safety first. Before the first motion of a party, show the safety card on the TV and every phone: give yourself room, hold on tight, a smooth motion reads as well as a wild one. motion.js does this for you.
  • iPhones ask first, and only on an https page. Published games are https; dev --host over Wi-Fi is plain http, so phones fall back to a touch pad there. Test motion on the published build.
  • Motion Lab is a free starter game and a public repo: a marble maze, home-run batting, fruit slashing, maracas and a kart you steer like a wheel. Read its code.

Online games

An online game has players on different devices in different places. It connects through PushPlay’s relay, and nothing else.

"online": true,
"modes": ["online-coop"]
npx github:Visual-Zone-Development/pushplay-kit new-game my-game --online --players 2-4

Only players on the same version play together. Keep messages small: the check notes a game that sends more than about 20 KB a second through the relay.

Camera games

A game the camera watches (body tracking, a dance game, waving at the screen) lists "camera" in inputs, beside the controls it also plays with.

  • PushPlay asks the player once, before the game’s first start: “Game wants to use your camera”, Allow or Not now. The answer is kept for that game and can be changed on its page.
  • Ask for video only. PushPlay never gives a game the microphone.
  • The picture stays on the device. Track the body on the device and bundle the model with the game; never send frames anywhere.
  • Play without it too. There’s no camera on a Steam Deck or most TVs, and a player may say Not now. Fall back to the other controls you list. A game that lists only "camera" gets a ⚠.

Phones as cameras

A party game can use each player’s phone as that player’s camera, so several people play at once, each tracked by their own phone, and the TV needs no camera at all.

"inputs": ["phones", "camera"],
"party": true
npx github:Visual-Zone-Development/pushplay-kit new-game my-game --party --controller camera
  • Tracking runs on the phone. The phone’s join page owns the camera: it explains in plain words that the video stays on the phone, then tracks the body and sends only the positions of the head, arms and legs to the game. The game never sees the picture.
  • camera in the manifest says where a camera game’s camera is: device (the screen’s own webcam), phones, or both. With "camera" and "phones" in inputs it means the phones unless you say otherwise.
  • Where it plays: a phone-camera game plays on a TV, a tablet and a PC or handheld, whether or not that device has a camera, and never on a phone (the phones are the controllers).
  • Camera Lab’s party mode is a full example, for up to four players.

Edit this page on GitHub · Something missing or wrong? Tell us.