This video is part of a video series where i try to build an Among Us clone in Javascript using Phaser.js. In this video the focus is on achieving multiplayer over websockets using a node server running express and socket.io.

Code links:
Start of video:
End of video:

Say hi on twitter:

Timestamps:
0:00 Intro
0:43 Install Socket.io
1:18 Create client socket
2:05 Emitting move event
3:00 Emitting moveEnd event
4:47 Creating Player 2
5:35 Receiving move event
6:23 Receiving moveEnd event
6:47 Handling Player 2 sprite flipX
7:50 Player 2 Run Animation
9:15 Websocket Server Setup
10:53 Socket.io server side events
12:30 VS Code Debugging setup
13:10 Finishing up server code
14:13 Debugging Sockets
15:56 Bugfix: playerMoved
16:43 Debugging with 2 players
17:55 Bugfix: Run animation
18:20 Bugfix: Player 2 sprite movement
18:35 Bugfix: Avoid receiving own event
20:30 Success!
20:40 Outro