Guide

How to make a board or card game multiplayer online

Updated 2026-11-23

Short answer: a turn-based board or card game needs one shared game state that every player sees, a rule for whose turn it is, and a way to invite friends. Latency barely matters, so the simplest netcode works: one player's device holds the true state and everyone else gets every change. With Joinable that's one script tag that syncs your existing game object, plus one line in your input handlers that ignores clicks when it isn't your turn. No server, no lobby code.

What a turn-based game actually needs

Board, card, word and puzzle games are the easiest kind to put online:

So you don't need prediction, rollback or a fast server. You need the state to be the same everywhere, moves to be applied once, and turns to be enforced.

How Joinable does it: shared world plus a turn check

Joinable's shared-world sync (Pattern A in the kit) works on the object your game already draws from:

For turns, keep whose turn it is in the synced state and ignore input from anyone else. That's Pattern C in the kit.

The code

If your state is a top-level variable in a classic (non-module) script, one tag after your game's scripts does the sync:

<script src="https://relay.getjoinable.com/sdk.js" data-sync="game"></script>

If it lives in a module or a class, load the script async and call sync once the state exists. The queue runs as soon as Joinable arrives, and never if it doesn't, so the game stays single-player offline:

<script async src="https://relay.getjoinable.com/sdk.js"></script>
(window.JoinableQ = window.JoinableQ || []).push((Joinable) => {
  Joinable.sync(game, { local: ['hover', 'selected'] }); // per-device things stay local

  // the host deals players in and out of the turn order
  Joinable.on('players', (players) => {
    if (!Joinable.isHost) return;
    game.seats = players.map((p) => p.id);
    if (!game.seats.includes(game.turn)) game.turn = game.seats[0];
  });
});

// in your click handler: only the player whose turn it is can move
function onCellClick(cell) {
  if (window.Joinable?.me && game.turn !== Joinable.me.id) return;
  placePiece(cell);
  game.turn = nextSeat(game.turn);
}

No key is needed on localhost. Before going live, get one free at getjoinable.com/app and add data-key="pk_…".

Before connecting, Joinable.me is null, so solo play (or pass-and-play on one device) works as before.

Make your state sync-friendly

Most problems come from the shape of the state, not the network:

Hidden hands and cheating

Everything in the synced state reaches every player's device. That's fine for open-information games (chess, Go, most board games) and for friends playing cards. But a player with developer tools could read another player's hand. If hidden information must stay hidden from a determined cheater, you need a server that deals the cards and shows each player only their own. Joinable doesn't run game code on its side today, and we'd rather tell you than have you find out.

Getting players in

Invite links come first. Joinable's play-online sheet leads with Invite a friend: on a phone it opens the share sheet (Messages, WhatsApp, Mail), on a computer the link is already copied. The friend's link opens the game straight into the room. The address bar is the invite link too (?join=…), so a copied URL works. Why invites beat matchmaking for small games: invite links vs matchmaking.

Board games with a score: full rounds

If your board or puzzle game is really a race to a score or a time (a daily puzzle, a word sprint), you may not need a shared board at all. Give everyone the same seeded puzzle and compare scores live with the score profile: see score games.

Test it

Open the game on localhost in two windows side by side, press Play online in one, and open the invite link in the other. Check that both show the same board, that a move in either shows up in both, that the wrong player can't move, and that closing the host window leaves the other playing. Or paste the prompt into your coding agent and let it follow the kit.

FAQ

Do I need a server for an online board game?

No. Joinable's hosted relay runs the rooms and keeps a copy of the board for late joiners. One player's device runs your game's rules; you write no server or WebSocket code.

How does it know whose turn it is?

Your game keeps it in the synced state, for example game.turn = playerId, and your input handlers ignore clicks when game.turn isn't Joinable.me.id. The host updates the turn order when players join or leave.

Can players see each other's cards?

Everything in synced state reaches every device, so a player with developer tools could read hidden hands. That's fine between friends. Keeping hidden information secret from a cheater needs a server that runs the game, which Joinable doesn't offer yet.

Is there a turns profile with a built-in turn timer?

A turns profile is planned, not built: Joinable accepts the name but doesn't carry its state yet. Today, turn-based games use the shared world plus a turn check in your own code, which is what this guide shows.

Does it work with my framework?

Anything that runs in a browser page: plain canvas or DOM, Phaser, PixiJS and others. See the canvas, Phaser and PixiJS guides.

Copy the prompt for your coding agent or sign up free