Wednesday 26 August 2020

Looking for tips on building a multiplayer game with Socket.io and node

I want to build a demo for my portfolio where everyone on a web page can see everyone's mouse location. This will be my first time using socket.io for a project so I was wondering if anyone would mind sharing some tips before I jump into it. I also have very little experience working with canvas. Here are my thoughts on how I would build it:On the client side:Run a loop in JS that checks the users mouse location on a canvas, stores the data in a JSON object and send it to the server.At the same time parse the incoming JSON object from the server that contains everyone's location and draw circles where they are.On the server side:Handle incoming JSON packages that contain individual user locations and combine them all into one JSON object before sending them out to all the clients again.Thank you! Also sorry if my explanation shows a lack of understanding of sockets. That is because I do not understand sockets!

Submitted August 26, 2020 at 08:19PM by TheSlothJesus

No comments:

Post a Comment