Skip to content
A very simple way to kick-start your multiplayer game development using express, socket.io and p5.js.
JavaScript HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
server Added colour May 8, 2019
.gitignore
README.md
package-lock.json
package.json

README.md


codeheir logo
p5-multiplayer-game-starter

A p5/node.js/express/socket.io starter to allow you to quickly develop multiplayer games

codeheir logo

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!

How to use

  1. git clone https://github.com/LukeGarrigan/p5-multiplayer-game-start.git
  2. npm install in the root directory
  3. npm start to get it running!

Details

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!

Demo

Player one joins

Player one joins

Player two joins

Player two joins

Player two leaves

Player two joins

You can’t perform that action at this time.