WebRTC
Two WebRTC peers talking on one screen, then a star-catching duel peer to peer, against a bot or online: the example game of JumPHP's WebRTC extension.
▶ Play
What you can try
- Two peers on this screen: two WebRTC connections inside your page talk through data channels. A PING comes back as a PONG with its round trip, and your cursor travels over an unreliable channel, like UDP.
- Practice against a bot: a star-catching duel. The bot has its own WebRTC peer and plays through it, like a remote player.
- Play online: two players meet on the relay, which only passes on their WebRTC signals; then the game goes straight from one browser to the other.
Controls
Keyboard: arrows, Space, Enter, Escape. Mouse or finger: click the buttons, hold to move. Phone: the on-screen pad works too.
Use it in your own game
The jumphp/webrtc extension: the same PHP code in the browser (RTCPeerConnection) and on the desktop (GStreamer).
tutorial, step by step · documentation · bin/jumphp extension:add <game> jumphp/webrtc
Screenshots