A React + NodeJS implementation of the classic 2-player game: Four-In-A-Row. Features online multiplayer.
- Node.js (Tested on
v14.16.0
) - JavaScript-capable browser (Tested on Google Chrome
v88.0.4324.150
)
- To play the Four-In-A-Row game, browse to
/client.html
of the host URL. (e.g: http://localhost:8000/client.html) - A new game will immediately start if an opponent was available. Otherwise, the player will wait for an opponent to connect
- One of the players is assigned the
X
piece while the other is assigned theO
piece - To make a move, the player clicks on the column in which they want to drop their piece
- The
STATUS
bar will display whose turn it is and when the match is won, lost or drawn - If the opponent could possibly win in the next move, columns on mouse-hover are highlighted red
- The first player to get 4 pieces in a row either horizontally, vertically or diagonally wins
- Open a Terminal window in the directory containing
server.js
and run:
npm install
- Run the Four-In-A-Row Server using the command:
npm start
- The server automatically restores from a previous backup on startup, if available
- The server state is automatically backed up at every turn update and player disconnect
- Server side turn verification to prevent cheating
- Columns on mouse-over are highlighted red if the other player could potentially win in the next move
- Server and player states preserved on server crash
- New game starts immediately as soon as previous ends
- Multiple parallel game instances
- Player notified if opponent leaves
- Online player count tracking