Starting a Game
BeeHex offers multiple ways to play depending on your preferences.Game Modes
Navigate to/game_mode to access the game setup interface:
Normal
Play online against other players with optional matchmaking
Offline
Local games on the same device without internet
Ranked
Competitive games that affect your MMR and leaderboard position
Configuring Your Game
Select Game Type
Choose between:
- Normal: Casual online matches
- Hors-Ligne: Local offline games
Ranked mode is only available for online games, not offline matches.
Set Time Limit
Choose the time limit per move (in seconds). Available options are defined in the game configuration.Current default: 0 seconds (untimed games)
Choose Board Size
Select from three board sizes:
- 5×5: Quick games, ideal for beginners
- 7×7: Standard competitive size
- 9×9: Advanced games with more strategic depth
Matchmaking Option
Select how to find opponents:
- “Chercher une partie”: Join matchmaking queue to find random opponents
- “Partie privée”: Create/join a private room with a custom code
Game Interface
Once your game starts, you’ll see:Hexagonal Board
The main game board displays:- Gray hexagons: Empty cells where you can place pieces
- Red pieces: Player 1’s moves (connecting top to bottom)
- Blue pieces: Player 2’s moves (connecting left to right)
- Loading spinner: Appears while connecting to game server
Player Information
The side panel shows:- Player names (yours and your opponent’s)
- Timer displays (format:
"X:XX") - Current turn indicator
For online games, player names are fetched from the database. Local games display “Joueur 1” and “Joueur 2” as defaults.
Making Moves
Online Games
Wait for Your Turn
The game instance tracks whose turn it is based on the turn number:
- Odd turns: First player (Red)
- Even turns: Second player (Blue)
Click a Valid Cell
Click any gray (empty) hexagon on the board. The system validates:
- Is it your turn?
- Is the cell empty?
- Is the game still in progress?
Local/Offline Games
Offline games use a local handler instead of WebSocket:- No internet connection required
- Moves are validated and processed instantly
- Both players take turns on the same device
- Game state is maintained locally in browser memory
Winning the Game
Victory Conditions
A player wins by creating an unbroken chain of their pieces connecting their two board edges:- Red player (Player 1): Must connect top edge to bottom edge
- Blue player (Player 2): Must connect left edge to right edge
Game End Sequence
When the game ends:- Server detects victory by checking for complete paths
- Game status updates:
FIRST_PLAYER_WIN(status: 1)SECOND_PLAYER_WIN(status: 2)
- Victory alert appears:
- “Victoire” (Victory) with trophy icon if you won
- “Défaite” (Defeat) with X icon if you lost
- Game transitions to review mode automatically
- Move history is saved for later analysis
Game States
The game client manages four distinct states:Loading State
- Establishing WebSocket connection
- Fetching game data from server
- Displaying loading spinner
- Initializing game board
Playing State
- Active game in progress
- Players can make moves
- Real-time updates via WebSocket
- Turn-based gameplay
Reconnecting State
- Connection to server lost
- Attempting to reconnect automatically
- Game state preserved locally
- Resumes when connection restored
If your connection drops during a game, the client automatically attempts to reconnect and rejoin the game in progress.
Reviewing State
- Game has ended
- Full move history available
- Analysis tools enabled
- Move slider for stepping through game
Game URL System
BeeHex uses special URL formats to identify game types:Online Games
/hex/o_abc123def456
- Connects to multiplayer server
- Fetches game from database
- Real-time synchronization
Local Games
/hex/l_0_5
- Offline gameplay (0 second time limit, 5×5 board)
- No server connection required
- Local state management
Game Review from Moves
/hex/m_0_5_0-6-12-18
- Replay specific game sequences
- Moves encoded as board position numbers
- Automatically enters review mode
Connection Management
WebSocket Connection
Online games use persistent WebSocket connections:Connection Recovery
Private Rooms
For playing with friends, see the Private Rooms guide for detailed instructions on creating and joining custom games.Game History
After each online game:- Match is saved to database
- Full move sequence recorded
- MMR changes calculated (for ranked games)
- Accessible via
/historypage
Quick Start Summary
Quick Local Game
Visit
/hex/l_0_5 to instantly start a 5×5 offline gameFind Online Match
Go to
/game_mode, select settings, click “Jouer”Next Steps
Private Rooms
Learn how to play with friends using room codes
Ranking System
Understand how MMR and ranks work