battleship Svelte Themes

Battleship

Battleship web browser game built in svelte using web sockets

Battleship

Installation

cd client/battleship_client
npm install

cd ../../server
npm install

Running the game

Starting the server:

node index.js

Starting the Web Client:

npm run dev

⚠️ Warning: If you’re encountering an error like WebSocket error from client: Invalid WebSocket frame: RSV1 must be clear on the server, and your client won’t connect properly, try changing the port number on both the server and client. This issue often occurs on macOS, where a hidden system process may already be using port 8080, interfering with WebSocket traffic and causing unexpected errors. Switching to a different port, such as 8081 or 3000, typically resolves the problem.

Top categories

Loading Svelte Themes