How to dynamically create rooms with socket.io and nodejs? Using Express server

533 views Asked by At

I am pretty new with socket.io. I have a basic idea of how sockets work logically, but when it comes to the code I am a bit lost.


The Goal

I am creating a multiplayer game. I want users to be able to create a new game on the home page and use a specified username. Once the game is created, they can share the link to the game and others can join (when they hit that link, they are prompted to enter the user name they desire).

If another user goes to the webpage and wants to create a completely separate game, they can.

Each different game would be the same layout, and functionality.


Additional

I would prefer there to be one of those "click to copy url" to share the game and each game has a different url then the next, but is respective in that fact that the page layout is the same.


Again, I am almost completely at a loss as to how to do this. I would love if someone could actually give a coded example of the functionality with the logic. Everything I have found on google and the docs don't make sense in my head.

0

There are 0 answers