Google Launches Cube Slam, An Open Source Pong Clone, To Show Off The Power Of WebRTC And WebGL

Google today launched Cube Slam, an open source pong clone that you can play against the computer or a friend in the browser. That by itself wouldn’t be all that exciting, but Google created this game to show off the power of WebRTC, Web Audio and WebGL.

For most people (or at least for developers), WebRTC is now synonymous with plugin-free video conferences in the browser and Cube Slam uses this to show you a live video and audio stream of your friend on a virtual screen while you’re playing.

Maybe more importantly, though, the game also uses WebRTC’s RTCPeerConnection and RTCDataChannel – two features most developers are probably not aware of – to send audio, video and all the “bits and pieces that keep the game in sync” back and forth between the two machines.

Google claims that Cube Slam is the ” first large-scale application to use RTCDataChannel, which provides an API similar to WebSocket, but sends the data over the RTCPeerConnection peer-to-peer link.”

For Google, the emphasis here is clearly on showing off the power of WebRTC, just like it focused on WebSockets with its Racer Chrome experiment, but it also wants to highlight what developers can do with WebGL and Web Audio.

The infrastructure for the game is hosted on Google’s Compute Engine and the code is available here.

Cube Slam is now available on Chrome for the desktop and Chrome OS. It’ll be available on Chrome for Android later this year, but you can already try it now by enabling the “WebRTC Android” setting in the chrome://flags menu.