Online Multiplayer Game Tutorial #3 - Connect and disconnect players

Published: 27 April 2023
on channel: Chris Courses
15,046
377

GitHub URL: https://github.com/chriscourses/multi...

Time to learn about backend connections with socket.io. There's a lot to cover here, but the most important takeaway is that all game data is stored on the backend and broadcasted to connected users.

This lesson will teach you how to:

Connect and disconnect players
Remove enemies
Install nodemon
Install [email protected]
Create initial connection
Create new http server
Use new http server required for socket.io server
Listen for a connection event
Create first player using sockets
Create multiple players with sockets
Remove players on disconnect and timeout

00:19 Remove enemies
02:45 Install nodemon
06:58 Install socket.io
08:37 Create initial connection
17:34 Create first player using sockets
33:02 Create multiple players with sockets
34:36 Disconnect players