A beautiful 3D Gomoku (Five in a Row) game that runs entirely in your browser. Play locally against AI or challenge friends online with zero installation - just a single HTML file!
- 🎨 Stunning 3D Graphics: Built with Three.js featuring realistic lighting, shadows, and smooth animations
- 🤖 AI Opponent: Three difficulty levels (Easy, Medium, Hard) with intelligent move evaluation
- 🌐 Online Multiplayer: Play with friends on different computers using WebRTC peer-to-peer connection
- 👥 Local Multiplayer: Two players on the same computer
- 🎯 Smart Features:
- Hover preview before placing pieces
- Undo moves
- Win detection with animation
- Responsive design
- Download the
gomoku-3d.htmlfile - Double-click to open in any modern browser
- Choose Game Mode:
- 👥 Two Players: Local multiplayer on same computer
- 🤖 vs AI: Play against computer with 3 difficulty levels
- 🌐 Online: Play with friends over the internet
| Action | Control |
|---|---|
| Place Piece | Left Click on board intersection |
| Rotate View | Drag with mouse |
| Zoom | Mouse wheel |
| Undo | Click "悔棋" button |
| Restart | Click "重新开始" button |
- Click the mode button until it shows "联机对战" (Online)
- Host:
- Copy the 6-character room ID
- Share it with your friend
- Wait for connection
- Guest:
- Switch to online mode
- Enter the room ID
- Click "加入" (Join)
- Start playing! Host plays as Black, Guest as White
- Easy: Basic defense and random offense
- Medium: Pattern recognition and position evaluation
- Hard: Advanced strategy with extended search range
- Engine: Three.js r128
- Networking: PeerJS (WebRTC)
- Board Size: 15×15 (Standard)
- File Size: ~49KB (single HTML file)
- No Dependencies: All libraries loaded from CDN
- ✅ Chrome / Edge (Recommended)
- ✅ Firefox
- ✅ Safari
- ✅ Opera
- 🎨 精美3D画面: 基于Three.js开发,真实光影效果和流畅动画
- 🤖 AI对手: 三种难度级别(简单、中等、困难),智能评估系统
- 🌐 在线对战: 使用WebRTC技术,无需服务器即可联机对战
- 👥 本地双人对战: 同一台电脑上两人对战
- 🎯 智能功能:
- 落子前预览
- 悔棋功能
- 胜负判定动画
- 响应式设计
- 下载
gomoku-3d.html文件 - 双击用浏览器打开
- 选择游戏模式:
- 👥 双人对战: 本地双人同机对战
- 🤖 人机对战: 与电脑AI对战,三种难度
- 🌐 联机对战: 与远方朋友在线对战
| 操作 | 控制方式 |
|---|---|
| 落子 | 左键点击棋盘交叉点 |
| 旋转视角 | 鼠标拖拽 |
| 缩放 | 鼠标滚轮 |
| 悔棋 | 点击"悔棋"按钮 |
| 重新开始 | 点击"重新开始"按钮 |
- 点击模式按钮切换到 "联机对战"
- 房主:
- 复制6位房间号
- 分享给朋友
- 等待连接
- 加入者:
- 切换到联机模式
- 输入房间号
- 点击"加入"
- 开始对战!房主执黑棋,加入者执白棋
- 简单: 基础防守 + 随机进攻
- 中等: 棋型识别 + 位置评估
- 困难: 高级策略 + 扩大搜索范围
- 引擎: Three.js r128
- 网络: PeerJS (WebRTC)
- 棋盘: 15×15 标准规格
- 文件大小: 约49KB(单个HTML文件)
- 零依赖: 所有库从CDN加载
- ✅ Chrome / Edge (推荐)
- ✅ Firefox
- ✅ Safari
- ✅ Opera
Coming soon - Add your screenshots here
[Screenshot 1: Game Board]
[Screenshot 2: AI Mode]
[Screenshot 3: Online Multiplayer]
- Download
gomoku-3d.html - Open in browser
- Play immediately!
git clone https://github.com/yourusername/gomoku-3d.git
cd gomoku-3d
# Open gomoku-3d.html in browser# Python 3
python -m http.server 8000
# Node.js
npx serve
# PHP
php -S localhost:8000Then open http://localhost:8000/gomoku-3d.html
Standard Gomoku (Five in a Row) rules:
- Black plays first
- Players alternate placing stones on board intersections
- First player to get 5 stones in a row (horizontally, vertically, or diagonally) wins
- Game ends when a player wins or board is full
You can easily modify the game by editing the HTML file:
// Change board size (default: 15)
const BOARD_SIZE = 19; // for 19×19 board
// Adjust AI difficulty
const aiDifficulty = 3; // 1=Easy, 2=Medium, 3=Hard
// Modify colors
const BOARD_COLOR = 0xDEB887; // Wood colorContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Add sound effects
- Add game timer
- Add move history/replay
- Support for different board sizes
- Mobile touch controls optimization
- Save/Load game state
Problem: Cannot connect to opponent
- ✅ Check internet connection
- ✅ Ensure both players use the same game version
- ✅ Try refreshing and rejoining
- ✅ Disable VPN if using one
Problem: Room ID not working
- ✅ Room ID is case-sensitive
- ✅ Must be exactly 6 characters
- ✅ Host must stay on the game page
Problem: Game runs slowly
- ✅ Close other browser tabs
- ✅ Use Chrome or Edge for best performance
- ✅ Update graphics drivers
- ✅ Disable browser extensions
This project is licensed under the MIT License - see the LICENSE file for details.
- Three.js - 3D graphics library
- PeerJS - WebRTC peer-to-peer library
- Inspired by traditional Gomoku games
- Author: Your Name
- Email: [email protected]
- GitHub: @yourusername
Last updated: February 2026