A modern, real-time multiplayer web gaming platform featuring Tic-Tac-Toe Pro and Dots and Boxes. Supports instant cross-device multiplayer via Node.js Socket.IO and WebRTC P2P (for serverless GitHub Pages hosting), smart AI engines, procedural sound effects, and a sleek neon dark/light UI.
🌐 Live Demo on GitHub Pages: https://amitpadhan.github.io/tic-tac-toe-multiplayer/
When you open the app, you are greeted by the Main Game Selector Hub:
- Tic-Tac-Toe Pro: Fast-paced classic 3x3 duel.
- Dots and Boxes: Territory capture with lines, closed boxes, and bonus turns!
- You can switch between games at any time using the 🕹️ Games button in the header.
- Online Match: Create a private 6-character room code. Connect across phones, laptops, and tablets in real-time.
- Solo vs AI:
- Easy: Casual practice.
- Medium: Blocks lines and takes immediate wins.
- Master (Unbeatable): Full Minimax algorithm with depth scoring and alpha-beta pruning.
- Pass & Play: Local 2-player mode on the same device.
- Territory Capture: Connect adjacent dots with glowing lines. The player who draws the 4th side of a 1x1 box claims that box (+1 point) and earns a BONUS TURN!
- Grid Sizes:
2x2 Boxes(Quick Blitz)3x3 Boxes(Classic 9 Boxes)4x4 Boxes(Pro Strategic 16 Boxes)
- Online Match: Play against friends on other devices in real-time.
- Solo vs AI:
- Casual: Fun, random play.
- Balanced: Takes open boxes and avoids giving away 3rd sides.
- Master: Strategic chain AI that controls initiative and minimizes chain sacrifices!
- Pass & Play: 2-player local mode with responsive touch controls.
- Start the server on your computer:
npm start
- The terminal displays your local network address:
====================================================== ⚡ Game Arcade Server running on port 3000 - Local: http://localhost:3000 - Network: http://192.168.1.X:3000 (Connect from another device!) ====================================================== - Open
http://192.168.1.X:3000on your mobile phone, tablet, or another computer on the same Wi-Fi. - On Device 1: Click Play Online -> Create Room to get a 6-character code (e.g.
K9M2P4). - On Device 2: Click Play Online -> Join Room -> Enter the code
K9M2P4. - Match begins instantly!
- Click Copy Link inside the waiting lobby. The link includes your room code (
?game=tictactoe&room=CODEor?game=dots&room=CODE). - Opening the invite link on another device auto-populates the room code and connects directly.
- 🔊 Zero-Dependency Sound Effects: Synthesized audio using browser-native Web Audio API (moves, line snaps, box completions, victory fanfare, reactions).
- 🎊 Confetti Cannon: Canvas particle celebration on match victory.
- ⚡ Neon Cyberpunk Aesthetic: Glowing cyan, pink, and indigo palettes with smooth animations.
- 🌗 Theme Switcher: Switch between Dark Mode and Clean Slate Light Mode.
- 📱 Mobile & Desktop Responsive: Optimized tap targets for easy line drawing and cell clicking on smartphones.
- 💬 Live Reactions: Quick floating emoji reactions (
🔥,👏,😂,😮,💀,GG). - 🔄 Rematch System: Quick rematch voting without needing to re-enter room codes.
git clone https://github.com/amitpadhan/tic-tac-toe-multiplayer.git
cd tic-tac-toe-multiplayernpm installnpm startOpen your browser at http://localhost:3000.
tic-tac-toe-multiplayer/
├── Dockerfile # Container definition
├── LICENSE # MIT License
├── README.md # Documentation
├── package.json # Project manifest and scripts
├── server.js # Node.js + Express + Socket.IO server (Multi-game)
├── index.html # HTML5 Game Hub & Game Arenas
├── style.css # Cyberpunk glassmorphism styles & responsive grids
├── assets/ # Favicons and SVG vector assets
├── js/
│ ├── app.js # Main Hub controller, routing & global UI
│ ├── network.js # Unified Socket.IO & WebRTC P2P Network Manager
│ ├── tictactoe.js # Tic-Tac-Toe Minimax AI & game engine
│ ├── dots.js # Dots and Boxes strategic AI & game engine
│ ├── confetti.js # Canvas particle explosion engine
│ └── sound.js # Web Audio API procedural sound synthesizer
└── public/ # Mirrored distribution files
- Socket.IO Real-time Events: Bi-directional event bus ensuring low-latency move broadcasts.
- WebRTC Peer-to-Peer Fallback: Enables low-overhead direct mesh matchmaking when server relay is optional.
This project is licensed under the MIT License © 2026 Amit Padhan.