An infinite chess game that supports up to 100 players simultaneously. Players can move their pieces on an unlimited board where pieces spawn with tile distance between them.
- Infinite Board: Unlimited chess board that expands as needed
- 100 Player Support: Up to 100 players can play simultaneously
- Real-time Multiplayer: Socket.io powered real-time game updates
- Cross-Platform: Works on desktop and mobile browsers
- Responsive UI: Adapts to different screen sizes
- Piece Movement: Standard chess piece movement rules
- Board Navigation: Zoom, pan, and minimap for exploring the infinite board
- Player Management: Live player list with status indicators
- Node.js (version 16 or higher)
- npm (comes with Node.js)
-
Clone or download the repository
-
Navigate to the project directory:
cd Chess2 -
Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and go to:
http://localhost:3000 -
Share the link with friends so they can join!
Development mode with auto-restart:
npm run devDirect node command:
node server.jsUsing the startup script (Unix systems):
./start.sh- Enter your name (or leave blank for auto-generated name)
- Click "Join Game"
- You'll be assigned a unique color and starting pieces
Desktop:
- Mouse Drag: Pan around the board
- Mouse Wheel: Zoom in/out
- Left Click: Select piece or move to square
- Right Click: Deselect piece
- Space Bar: Center view on your pieces
- Ctrl/Cmd + Plus/Minus: Zoom in/out
Mobile:
- Touch Drag: Pan around the board
- Pinch: Zoom (if supported)
- Tap: Select piece or move
- Mobile Controls: Use on-screen buttons for zoom, center, etc.
Each player starts with a standard chess set:
- 8 Pawns ♙
- 2 Rooks ♖
- 2 Knights ♘
- 2 Bishops ♗
- 1 Queen ♕
- 1 King ♔
Chess pieces follow standard movement patterns:
- Pawns: Move one square in cardinal directions (simplified for infinite board)
- Rooks: Move horizontally or vertically any number of squares
- Bishops: Move diagonally any number of squares
- Knights: Move in L-shape (2+1 squares)
- Queens: Combine rook and bishop movement
- Kings: Move one square in any direction
Infinite Board: The board has no boundaries - pieces can move infinitely in any direction.
Multiplayer: Up to 100 players can join and play simultaneously. Each player gets a unique color.
Real-time Updates: All player moves are synchronized in real-time across all connected clients.
Board Exploration: Use the minimap and navigation tools to explore different areas of the infinite board.
The server runs on port 3000 by default. You can change this by setting the PORT environment variable:
PORT=8080 npm startThe maximum number of players is set to 100 by default. This can be changed in server.js:
const MAX_PLAYERS = 100; // Change this valuePieces spawn with a minimum distance between player starting positions. This can be adjusted in server.js:
const SPAWN_DISTANCE = 16; // Minimum distance between player spawn pointsChess2/
├── server.js # Main server file
├── package.json # Dependencies and scripts
├── start.sh # Unix startup script
├── public/ # Client-side files
│ ├── index.html # Main HTML file
│ ├── css/
│ │ └── styles.css # Responsive CSS styles
│ └── js/
│ ├── main.js # Main application logic
│ ├── board.js # Chess board rendering and interaction
│ ├── ui.js # UI management and controls
│ └── game.js # Chess game rules and logic
└── README.md # This file
- Node.js with Express.js for HTTP server
- Socket.io for real-time WebSocket communication
- UUID for unique player identification
- In-memory game state (no database required)
- Vanilla JavaScript (no frameworks)
- HTML5 Canvas for board rendering
- CSS3 with responsive design
- Socket.io Client for real-time communication
- Infinite coordinate system using integer coordinates
- Efficient rendering - only visible board sections are drawn
- Spiral spawn pattern ensures minimum distance between players
- Dynamic piece loading based on viewport
Desktop:
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
Mobile:
- iOS Safari 12+
- Chrome Mobile 60+
- Android Browser 81+
- Check that Node.js is installed:
node --version - Ensure port 3000 is available or set a different port
- Check for error messages in the terminal
- Make sure your firewall allows connections on the port
- Use your computer's IP address instead of localhost
- Example:
http://192.168.1.100:3000(replace with your actual IP)
- Try refreshing the browser
- Close other browser tabs to free up memory
- Check your internet connection for real-time updates
- Ensure you're using a modern mobile browser
- Try both portrait and landscape orientations
- Use the mobile control buttons instead of gestures
The codebase is modular and easy to extend:
- server.js: Server-side game logic and Socket.io events
- public/js/main.js: Main application and screen management
- public/js/board.js: Board rendering and user interaction
- public/js/ui.js: User interface and player management
- public/js/game.js: Chess rules and move validation
npm run devThis uses nodemon to automatically restart the server when files change.
MIT License - Feel free to modify and distribute!
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues or questions:
- Check the troubleshooting section above
- Verify your Node.js and browser versions
- Try running on a different device/browser
Enjoy playing Chess 2 with your friends!