Anticode Open builder

Make a two-player game people play on the same device

Some of the best two-player games never needed the internet: two people, one screen, taking turns or sharing a keyboard. That's what Anticode can build. Online multiplayer, where two people on different devices play together, needs a server to pass moves between them, and Anticode apps have no network, so it isn't possible here.

Updated · By the Anticode team

Three ways to share one device

Pass and play
Players take turns and hand the phone or tablet across. Suits board-style games: noughts and crosses variants, connect-four style drops, dots and boxes, draughts, word duels. If a turn has hidden information (a hand of cards, a secret choice), add a "pass to Player 2" screen that hides the board until they tap.
Split keyboard
Both players on one laptop at the same time, one on WASD and one on the arrow keys. Suits real-time games: tank duels, racing, air hockey, a two-snake game. Keyboards can drop keys when several are held at once, so keep each player to four or five keys.
Shared touch screen
A tablet flat on a table, each player owning one half. Suits reaction games and air hockey. Mirror the interface so each player reads their side the right way up.

Choose one. Each shapes the controls, the layout and the pace, and a game designed for all three tends to be awkward in each.

Design points for two players

  • Make whose turn it is unmissable. A colour wash on the active side, the player's name large, and a short sound on change.
  • Balance the start. In turn-based games the first player often has an edge; alternate who starts each round, or give the second player a small compensation.
  • Catch-up without unfairness. Real-time games feel better when the losing player has a slight chance to come back, such as a power-up that appears more often on their side. Too much and winning feels random.
  • Short rounds, running score. Best of five rounds of a minute keeps both people at the table longer than one ten-minute match.
  • Names and colours. Let players type their names and pick colours at the start; it costs little and makes the result screen personal.

A computer opponent for one

Most two-player games benefit from a single-player mode for when nobody else is around. For board-style games the model can write a computer opponent that searches a few moves ahead, with an Easy setting that deliberately makes mistakes. Anticode's sandbox rules ask for anything standing in for another person to be labelled, so the game will say "Computer opponent" rather than pretend someone is online.

Describing it to Anticode

When you use Anticode as a two player game maker, give the format, the rules and the length of a round: "A pass-and-play game for two on a phone: a 7 by 7 grid, players take turns placing walls to trap the other's token, first one unable to move loses. Hide nothing, so no pass screen. Best of three, names at the start, alternate who goes first, and an optional computer opponent with Easy and Hard." For a real-time game, name the keys for each player and the screen layout.

The model writes the game as one HTML document, with the board or arena drawn in canvas or SVG and sounds generated in code. The game opens on a start screen with the controls for both players shown, since key presses only reach the game once someone has clicked or tapped it. Scores and names can save on the device, so a running family tally survives until next weekend.

Why online multiplayer isn't possible

To play with someone on another device, each move has to go to a server and on to the other player, or between the two browsers directly. Anticode apps run in a strict sandbox with no network of any kind: no WebSockets, no WebRTC, no requests out. That's a deliberate security choice, and it means:

  • No online matchmaking, lobbies or friend invites.
  • No play-by-link where you send a game to a friend and they make their move later.
  • No chat between players.
  • No shared leaderboard.

One workaround some turn-based games use is a move code: the game shows a short code describing the current position, you message it to your friend, and they paste it into their copy. It works, but it's clunky, and only worth it for slow games such as chess-by-message. For real online multiplayer, build with a game engine or a framework that includes a server; the game prototype page covers using Anticode to test the idea on one device first.

For solo play with cards, see the card game maker, and for keeping score of games played in person, the scoreboard app.

Questions people ask

Can two people play on two phones in the same room?

Not together. Each phone runs its own separate copy of the game with no way to talk to the other.

Does it work with two game controllers?

Ask for controller support in the request and test it with your own controllers; keyboard and touch are the defaults.

Can I add a third or fourth player?

Yes, for pass-and-play. On a shared keyboard, more than two players usually run out of comfortable keys.