A very simple way to kick-start your multiplayer game development using express, socket.io and p5.js. It represents an opinionated approach to multiplayer game development which should allow you to skip the laborious beginning boiler-plate steps. Please check out my blog https://codeheir.com/2019/05/11/how-to-code/ for more information on the repository and how to code multiplayer games!
git clone https://github.com/LukeGarrigan/p5-multiplayer-game-start.git
npm install
in the root directorynpm start
to get it running!
The project is very simple, it sets up a client Player
class and a server Player
. Every 16ms the server emits the current state of the game to the client. If a new client joins the server a new Player
will be added to the game and displayed on all clients, it also automatically removes players when they leave the game. These are the standard features I frequently have to reproduce when creating a new multiplayer game, so I hope you find this as useful as I do!