New Release: Discord Activity API v0.0.73

Read more

Build multiplayer games in minutes

Playroom provides scalable multiplayer backend and cross-platform integrations for web-based games. Build effortlessly with zero server setup.

rectangle with a light background

Built for the next generation of multiplayer

Multiplayer configurations and tools to create games previously only feasible by large-scale teams now possible by EVERYONE.

Casual
Build real time mobile and web games
Social
Build worlds with avatars and in game communication
Stream
Build games that take multi user and multi device inputs
Embedded
Build games that brings 100s together from across the world

Get started in
minutes

Simple API to set or get the state of game room. The state is automatically synced between all players and screens.

npm install --save playroomkit react react-dom

React
Phaser
import { insertCoin, myPlayer, usePlayersList } from 'playroomkit';
import ReactNipple from 'react-nipple';

function Game(){
  // Hook that returns an array of players in the room.
  const players = usePlayersList();

  // We render all players and a joystick for current player.
  return (
    <Physics gravity={{y: 1600}}>
      {players.map((playerState) => (
        <Player key={playerState.id} player={playerState} />
      ))}

      <ReactNipple
          onEnd={()=> myPlayer().setState("dir", undefined)}
          onPlain={(e, data)=> 
            myPlayer().setState("dir", data.direction)} />
    </Physics>
  )
}

function Player({player}){
  // Playroom hooks to get and set a player's state.
  // Setting state here will automatically sync value 
  // with other players.
  const [pos, setPos] = usePlayerState(player, "position", {x: 0, y: 0});
  const [dir] = usePlayerState(player, "dir")

  const [bodyRef, setBodyRef] = useRef(null);

  useState(()=>{
    // One player acts as a host, host checks the joystick state for
    // each player, applies forces to the player and updates their pos.
    if (!isHost() || !dir) return;
    if (dir.x === "left"){
      bodyRef.current.applyForce({x: -100, y: 0});
    }
    if (dir.x === "right"){
      bodyRef.current.applyForce({x: 100, y: 0});
    }
    if (dir.y === "up"){
      bodyRef.current.applyForce({x: 0, y: -100});
    }
  }, [dir]);

  return (
    <Sprite
      ref={setBodyRef}
      x={pos.x}
      y={pos.y}
      onPositionChange={(pos)=> setPos(pos)}
      color={player.getProfile().color.hex}
    />
  )
}

// Initiates the lobby UI and resolves promise
// when the players have all connected in the same room.
insertCoin().then(()=>{
  ReactDOM.render(<Game />, document.getElementById("root"));
})

Save development & maintenance time

No longer will you have to oversee WebSocket, TCP, and webRTC protocols, along with server monitoring. You focus on your game and Playroom manages all other aspects.

feature icon
Zero Backend Setup
Serverless architecture with no backend code to write or manage
feature icon
Region: Earth
Nearest websocket backend running within milliseconds of the players
feature icon
Low Latency
Automatically switch between WebRTC and WebSockets for <50ms latency.
feature icon
Low code SDK
Six lines of code to run multiplayer within minutes on any engine

Ship faster with easy-to-use integrations & toolkit

Multiplayer modules can be seamlessly integrated into any game, accelerating development and facilitating rapid play testing.

Resources

Start ahead of the curve with an ever-expanding library of open-source game templates and cross-platform resources. Leverage Playroom to kick start your next blockbuster game.

Let’s Connect

Looking for help? We are just a message away.