...loading
salim.codes...loading
salim.codesA real-time multiplayer Tic-Tac-Toe game powered by WebSockets with synchronized gameplay, turn management, and automatic timeout handling.
Demo
Screenshots
Features
Real-Time Multiplayer
Synchronizes gameplay between two connected players using WebSockets, allowing moves to appear instantly on both clients.
Server-Authoritative Game Logic
The server validates every move, controls turn order, determines winners, and ensures both players remain synchronized.
Automatic Turn Timer
Implements a countdown timer that automatically transfers the turn if a player does not make a move within the allotted time.
Connection & Match Management
Handles player connections, prevents additional users from joining active matches, supports rematches, and resets sessions when games end.
Why it was built
Building upon the first version, this project transforms the application into a fully interactive real-time multiplayer experience. Socket.IO is used to establish persistent WebSocket connections, enabling bidirectional communication between the server and connected clients. The server acts as the single source of truth, managing player connections, synchronizing game state, enforcing game rules, handling timeouts, and coordinating rematches.
Tech stack
Node.js
Runs the backend server and game logic.
Express.js
Serves the application and manages HTTP endpoints.
Socket.IO
Provides bidirectional WebSocket communication for real-time multiplayer gameplay.
JavaScript Timers
Implements automatic turn timeouts and manages timed game events.