A modern, interactive web-based Snakes & Ladders board game built for couples and friends — especially designed for long-distance relationships (LDR). Play together on a single screen or connect seamlessly across different networks using instant room links.
-
🌐 Realtime Online Multiplayer (LDR Mode):
- Instant room creation with 6-character room codes or shareable direct links (
?room=UT-XXXX). - Powered by Cloud WebSockets (WSS) — connects instantly across different ISPs, mobile data, and Wi-Fi networks without firewall/NAT issues.
- Spectator-safe card view: only the active player can interact with their event card while the partner watches in real time.
- Instant room creation with 6-character room codes or shareable direct links (
-
🎲 1-Device Offline Mode:
- Pass-and-play on the same phone, tablet, or laptop.
-
🎴 Dynamic Event Tiles & Fate Cards:
- ❓ Romantic & Deep Questions: Conversation starters to get to know each other better.
- ⚡ Fun & Spicy Challenges: Playful tasks and dares.
- 🎴 Wildcard (Kartu Risiko): 3D flipping fate cards that trigger unexpected twists (position swaps, runaway horse crashes back to START, extra dice rolls, etc.).
- ✨ Tile Metamorphism: Event tiles change into new random event types after being stepped on.
-
🌪️ Global Board Disaster Events:
- 🐍 Snake Outbreak: 16 giant snakes suddenly take over the board for a few rounds!
- 🪜 Ladder Rain: Giant ladders drop down across the board.
- 💨 Windstorm: Fierce gusts blow players backwards by 2 steps every roll.
-
🤖 Cute Customization & Responsive Board:
- Customizable names and robot avatar presets.
- Dynamic SVG-rendered snakes and ladders that adapt to any screen size.
- Crisp sound effects and smooth pawn movement animations.
- Open the game in your browser.
- Choose Offline Mode (1 Device) or Main Online (LDR Mode).
- If playing online:
- Host: Click Buat Room ➔ click Salin Link ➔ send the link to your partner.
- Guest: Simply open the link (the room code auto-fills) and click Gabung & Main.
- Take turns rolling the dice, answer questions, survive the snakes, and race to tile 100!
- Frontend: Pure Vanilla JavaScript (ES6+), Semantic HTML5, CSS3 (Flexbox & Grid, CSS variables, keyframe animations).
- Graphics & Assets: Dynamic SVG overlay rendering for snakes & ladders, DiceBear Bottts neutral avatars, FontAwesome icons.
- Networking: Secure WebSockets over MQTT (
wss://) on port 443 for zero-latency bidirectional state sync.
├── index.html # Main HTML markup & modal structures
├── css/
│ └── style.css # Game layout, board styles, animations, responsive design
├── js/
│ ├── app.js # App initialization, modal logic, URL parsing, sound toggles
│ ├── board.js # Board grid generation, tile math, dynamic SVG snake/ladder rendering
│ ├── game.js # Turn state machine, pawn animations, event cards, state sync
│ ├── dice.js # 3D dice physics & roll animations
│ ├── questions.js # Bank of questions, challenges, romantic cards & wildcards
│ ├── network.js # WebSocket realtime synchronization engine
│ └── sound.js # Web Audio API sound synthesizer
└── README.md # Documentation
No complex build tools, npm install, or bundlers required.
- Clone this repository:
git clone https://github.com/HaikalAska/SNAKE-Multiplayer.git cd SNAKE-Multiplayer - Serve the folder using any static web server:
- Using Python:
python -m http.server 8080
- Using PHP:
php -S localhost:8080
- Or open
index.htmldirectly with VS Code Live Server.
- Using Python:
- Open
http://localhost:8080in your browser.
This project is open source and available under the MIT License.