If you are interested in hosting the game, go further down to Hosting.
MultiplayerGame is a multiplayer real-time snake strategy game where you compete versus your friends for the most area, inspired by splix.io and paper.io. The game uses vanilla Javascript, express and socket.io.
You can control the snake using the arrows or WASD keys on your keyboard.
1. Each player get their own starting area and snake. 2. If you eat your own snake you restart. 3. If you eat another snake they die. 4. The area enclosed by your snake will be claimed when when you return to your already claimed area.To play the game there are two alternatives.
- You find someone who is hosting the game and connect to their server.
- You host your own server (offline or online)
Given the likelihood of finding someone else who is hosting, you are likely to end up hosting yourself. Therefore, we have included a guide for hosting.
To run a server for the game you need to have node.js
, npm
, express
, socket.io
and uuidv4
installed. You can install node.js from https://nodejs.org/en/download/
. Thereafter, you need to run npm install express
, npm install socket.io
, npm install uuidv4
in the terminal.
You are now ready to launch the server. Go to the directory where you have stored the repo and run node .\src\server\server.js
. Running the command will open a server on port 80.
To connect locally, you can type localhost:80
in your web browsers url bar to play the game on your own PC.
Alternatively, you can access from within LAN by connecting to the server on port 80. (You need to know the servers local IP address). Moreover, if you want players from outside your LAN to be able to connect, you can portforward port 80, opening it up for others to access via your public IP.