Add simple WebSocket multiplayer

This commit is contained in:
2026-05-05 11:40:05 -04:00
parent 2833d9610a
commit c7dcc71707
7 changed files with 495 additions and 33 deletions

View File

@@ -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.