Arcade (local multiplayer)
Two-Device Pong Paired Over Sound (No Network)
Tested with Claude · produced Chirp Pong
The Prompt
You are a senior HTML5 game developer and an audio engineer. Build a two-device paddle game as ONE self-contained HTML file (inline CSS/JS, no libraries, no external assets, no network requests at runtime). Transport requirement — the hard part: - The two phones must pair and exchange the ball using ONLY their speaker and microphone. No Wi-Fi, Bluetooth, accounts or server. - Implement a simple FSK audio modem: a short handshake (call/answer) followed by tiny encoded packets for ball launch, paddle position and hit events. - Use the Web Audio API with an AudioContext at 48kHz, a band-limited chirp around 2-4kHz, and a matched filter or Goertzel detector on the receiving side. - Add automatic gain control, echo suppression and a retry/ack loop so a dropped packet never desyncs the match. - Show a visible pairing state: idle, calling, listening, paired, and a clear retry path if pairing fails within 15 seconds. - Include a practice mode against a CPU so a single player can test the game without a second phone. Gameplay: - Each phone is half the court; the top edge is a portal the ball flies through. - Drag anywhere to move the paddle; hitting with the paddle edge changes the angle; a sideways swipe adds spin that keeps curving on the other screen; flick up for a smash. - Trick gems on the court load one effect that fires on the opponent screen: speed boost, invisibility, mirage split, bomb, vortex, mirrored controls, shrunken paddle. - Heat system: 6+ hits makes the point worth x2, 12+ hits x3. A bomb meter charges on every return and is spent by tapping the opponent’s court. - First to 7, 11 or 15 points, selectable on the start screen. Loser serves. Pause on blur. Performance and robustness: - 60fps game loop with delta time, responsive letterboxed canvas, touch-first input with 44px minimum targets. - Degrade gracefully: if the microphone is unavailable or permission is denied, keep practice mode fully playable and explain why. - No text or links that navigate away, no audio files, all sound synthesized. After the code, print the packet format (field, bits, meaning) and a 5-step manual test plan for two real phones.
What This Prompt Produces
The audio modem is the risky part, so the prompt isolates it: handshake, packets, ACK/retry and a practice fallback. Chirp Pong on this site is the real-world proof that the approach works between two phones on a table — and that players understand it instantly once they hear the ball arrive.
Modification Tips
- Start with the transport and the practice mode; add trick gems only after pairing is reliable on your own devices.
- Ask for the packet format explicitly — without it the model hand-waves the sync logic.
- Raise the chirp frequency range if a room is noisy, and lower it if phone speakers sound thin.
- Test with the phones top-to-top, a few centimetres apart, volume at maximum and silent mode off.
The Game This Prompt Produced
Want to try it? Open Claude, paste the prompt, and you'll have a playable game in minutes. When you're happy with the result, submit it to Daily AI Games.