HeadlinesBriefing favicon HeadlinesBriefing.com

TouchCoop: Phone-Based Couch Co-op Gaming

DEV Community •
×

A new TypeScript library called TouchCoop lets players use their phones as game controllers for browser-based games. Hosts run the game on a TV or laptop, and up to four players join by scanning a QR code. Inputs travel via WebRTC, eliminating the need for Bluetooth pairing or physical gamepads.

This approach is ideal for casual party games like platformers or local puzzles. However, the library notes it isn't suited for low-latency genres like first-person shooters, where WebRTC's performance isn't esports-level. The entire system operates on static web pages, requiring no backend server beyond an initial signaling phase.

Developers can implement it by creating two entry points: a Match page for the main game and a Gamepad page for each phone. The host generates a QR code for new players, who then send touch events directly to the game. It’s a clever demonstration of modern browser APIs enabling couch co-op without native apps.