Add simple WebSocket multiplayer
This commit is contained in:
20
README.md
20
README.md
@@ -11,9 +11,23 @@ A notepad-playable browser game that combines Tic Tac Toe's line-making goal wit
|
||||
- First player to make `4 in a row` wins.
|
||||
- If the board fills with no winner, the game is a draw.
|
||||
|
||||
## Run
|
||||
## Run Multiplayer
|
||||
|
||||
Open `index.html` in a browser.
|
||||
```powershell
|
||||
npm start
|
||||
```
|
||||
|
||||
No build step is required.
|
||||
Then open `http://localhost:3000` in two browser windows. The first two connected players are paired automatically.
|
||||
|
||||
Set a different port with:
|
||||
|
||||
```powershell
|
||||
$env:PORT=4000; npm start
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- No authentication or user accounts are required.
|
||||
- The server keeps games in memory only.
|
||||
- If an opponent closes their window, the remaining player sees a disconnect error and waits for a new player.
|
||||
- No build step is required.
|
||||
|
||||
Reference in New Issue
Block a user