To explore a real-time web application, I implemented a version of Arkanoid using WebSockets. In this example, the game logic runs on the server.
The browser acts as a thin client: it renders graphics and communicates the state of the controls.

Divide the responsibilities
- Server: maintains the rules and game state, including positions, score, level, and lives.
- Client: collects player input and draws the data it receives.
- WebSocket: maintains the communication channel between them.
One player, an architecture to study
This version is single-player. Its purpose is to separate the simulation from the machine displaying it and follow the messages exchanged between the two.
The second article, about agar.io, continues the experiment with a multiplayer game.