Snake is an early RCWeb asymmetric prototype that turns one shared display into a multiplayer snake board while phones act as directional pads. It is useful both as a playable experiment and as a developer-facing example of the older RCWeb style where controllers call explicit viewer methods and the viewer pushes targeted JavaScript back to specific controllers.


On the screen, Snake is straightforward: multiple snakes share one grid, compete for the same fruit, grow when they eat, and crash if they hit another body or their own. When a snake dies, its score resets and it waits through a respawn countdown before re-entering the board.
What makes this prototype interesting for RCWeb developers is the way it coordinates per-player state without any backend game session model beyond the RCWeb room. Each phone becomes a player purely by sending its rc.client id to the viewer. The viewer builds that snake entity locally, keeps all authoritative game state on the display, and targets score or respawn updates back to the correct controller.
Snake uses the classic early asymmetric RCWeb pattern:
/snake/ is the authoritative viewer./snake-control/ is the lightweight controller.rc.send(js, "!" + rc.client).The communication surface is intentionally tiny:
snakeGame.up(id), snakeGame.down(id), snakeGame.left(id), and snakeGame.right(id).rc.send("snakeGame.up('" + rc.client + "');", "snake").rc.client value becomes the snake id on the viewer.The viewer then sends targeted updates back to the controller app, again using plain JavaScript strings:
window.updateScore(score) for score changeswindow.updateColor(hue) when a snake is first assigned a colorwindow.startCountdown(seconds) after a crashThose messages are scoped to the correct phone by checking rc.client inside the outbound code before invoking the controller-side function.
For someone writing a new RCWeb game, Snake is a clean example of the communication fundamentals:
rc.client.This prototype is especially helpful if you want to understand the "raw" RCWeb model before adopting later conveniences like richer snapshots or more structured controller state. It shows how little code is actually required to build a working asymmetric multiplayer app when the room, client ids, and remote JavaScript dispatch are already provided by RCWeb.