https://github.com/ivangfr/socketio-express-phaser3
The goal of this project is to implement a multiplayer game using Socket.IO, Express and Phaser 3.
https://github.com/ivangfr/socketio-express-phaser3
expressjs game javascript multiplayer-game ngrok phaser3 socket-io
Last synced: about 1 year ago
JSON representation
The goal of this project is to implement a multiplayer game using Socket.IO, Express and Phaser 3.
- Host: GitHub
- URL: https://github.com/ivangfr/socketio-express-phaser3
- Owner: ivangfr
- Created: 2020-01-13T12:09:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-21T11:44:14.000Z (over 1 year ago)
- Last Synced: 2025-03-24T08:42:35.540Z (about 1 year ago)
- Topics: expressjs, game, javascript, multiplayer-game, ngrok, phaser3, socket-io
- Language: JavaScript
- Homepage:
- Size: 8.1 MB
- Stars: 23
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# socketio-express-phaser3
The goal of this project is to implement a multiplayer game using [`Socket.IO`](https://socket.io/), [`ExpressJS`](https://expressjs.com/) and [`Phaser 3`](https://phaser.io/phaser3).
## Proof-of-Concepts & Articles
On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-Concepts (PoCs) and articles. You can easily search for the technology you are interested in by using the filter. Who knows, perhaps I have already implemented a PoC or written an article about what you are looking for.
## Additional Readings
- \[**Medium**\] [**Creating a Multiplayer Game with Socket.IO, Express.js and Phaser 3**](https://medium.com/@ivangfr/creating-a-multiplayer-game-with-socket-io-express-js-and-phaser-3-51e022d49326)
## Prerequisites
- [`Node.js`](https://nodejs.org/en/)
- [`ngrok`](https://ngrok.com/), in case you want to expose the game, running on your local machine, to the internet
## Car images
We are using this beautiful car image!

Thanks [Freepik](http://www.freepik.com) for designing it!
## Start game
- Open a terminal and navigate to `socketio-express-phaser3` root folder
- Execute the command below if you are running it for the first time
```
npm install
```
- Run the following command to start the game server
```
node server.js
```
## Play game
- Open a browser and access http://localhost:5000
- The GIF below shows two users playing at the same time

## Expose game to the internet
- While the server is running in one terminal, open another terminal and run the following command
```
ngrok http 5000
```
- Share the `Forwarding` url with your friends
```
...
Forwarding http://cf...0a.ngrok.io -> http://localhost:5000
Forwarding https://cf...0a.ngrok.io -> http://localhost:5000
...
```
## How to upgrade dependencies to latest version
- In a terminal, make sure you are in `socketio-express-phaser3` root folder
- Run the following commands
```
npm upgrade
npm i -g npm-check-updates
ncu -u
npm install
```