Dev.to · 5 min read

Play Board Games Online With Friends: How I Added Online Rooms to 22 Browser Games

Play Board Games Online With Friends: How I Added Online Rooms to 22 Browser Games

Pass and Play Games started as a one-device site: 37 board, dice and party games you play by passing a single phone around the table. That works well until two things happen. Your friends are not in the same room. The game has secrets. Sea Battle needs hidden fleets, Imposter needs a secret word, and on a shared phone both depend on everyone politely looking away. So I added online rooms. 22 of the games now play online: one person starts a room, shares a link or a 6-character code, and everyone plays on their own phone, tablet or laptop. Nobody signs up and nothing is installed. Here is what changed, and the design decisions that mattered more than I expected. What a room looks like Pick a game and tap Create a room. You get a link, a 6-character code and a QR code for people sitting next to you. Friends open the link or type the code, enter a name, pick a colour and take a seat. The host taps Start. Everyone sees the same game on their own screen. There is no account step anywhere. The name you type stays on your device, so next time it is already filled in. The 22 online games Group size Games 2 players (duels) Chess, Checkers, Tic-Tac-Toe, Sea Battle, Backgammon, Mancala, Reversi, Four in a Row, Gomoku, Royal Game of Ur, Ultimate Tic-Tac-Toe, Nine Men's Morris 2 to 4 Ludo, Dots and Boxes, Shut the Box Big groups (up to 12) Truth or Dare, Draw and Guess, Imposter, Snakes and Ladders, Chinese Checkers, Yacht Dice, Hot Dice The full list with player counts is on the online games page. Decision 1: the server is the referee On one device, the device is the referee. Online, there are three or four devices and they all have to agree. So every move goes to the server first. The server checks it against the rules, and only then does it reach the other screens. An illegal move never reaches your friend's phone, and two phones can't end up showing two different boards. The dice work the same way. The server rolls them, so every screen shows the same throw. In online Ludo, the Roll button appears only on the phone whose turn it is. Decision 2: hidden information stays on the server This is the part that made online play better than passing a phone, not just more convenient. Sea Battle: both fleets live on the server. A ship that hasn't been hit is never sent to the other player's device, so there is nothing to find in the browser's dev tools. Both players also place their fleets at the same time, instead of one after the other behind a pass screen. Imposter: the server deals the secret word from built-in lists, so even the host doesn't know it and can play like everyone else. Every player opens their own card at the same moment, holds to read it, and taps Ready. If you build multiplayer games, this is the rule I would steal: send each client only what that player is allowed to see. Hiding it in the UI is not enough. Decision 3: the clock lives on the server Online chess has an optional clock (3+2, 5+0, 10+0, 15+10). The clock runs on the server, not on either phone, so both screens always show the same time and the flag falls on the server. The side effect is honest: locking your screen or switching apps pauses nothing. If it is your move, your time keeps running. On a weak connection you lose real seconds while your phone reconnects, so the page simply recommends Wi-Fi for fast time controls. Decision 4: dropping out is normal, not an error On phones, people get calls, lose signal and switch apps all the time. So: Your seat is kept. Opening the link again on the same device puts you straight back into the game. Everyone else sees why the game paused. A note says the player's seat is kept, and the board waits for them. Watchers can step in. Anyone who joins after the seats are full watches the game. If a player is gone, the host can give the empty seat to a watcher, so a Ludo race doesn't die because one cousin's battery did. After two minutes away, the host can also end the game. Decision 5: rematches keep the room Friends rarely play just one game, so a series should need only one link. Rematch keeps the same room, the same settings and the score. In chess the colours swap each rematch, and the wins follow the people, not the colours. What is deliberately missing No chat or voice. Most people play alongside a call or a group chat they already have open, so the room doesn't try to be another messaging app. No computer players online. The one-device versions have computer opponents for practice. Online rooms are for people. Internet is required. The one-device games still work offline after your first visit. Online play obviously can't. Rooms are private (only people with the link or code can join) and close by themselves after the game. The server keeps a room's names and moves only while the room is open. Which one to try first Two friends in different cities: Chess with a 10+0 clock, or Sea Battle. Family group chat: Ludo. Drop the link in the chat and start when four names appear. Friends on a video call: Imposter or Draw and Guess. Every game is free, with no sign-up and no download: play board games online with friends. If you're sitting together, the original pass-and-play games on one device are still the simplest option. I'd love feedback from people who have built real-time games: how do you handle a host who leaves mid-match, and do you let players reconnect on a different device? I run Pass and Play Games. I wrote this post with help from an AI assistant; every feature described here is live on the site.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More Sports News