Hi guys,
I'm pretty new to Node.JS and socket IO, so I was wondering if I could get some guidance on project I'm working on. I would like to build a single page multiplayer game that basically communicates solely through socket.IO.
However, I am quickly seeing that my socket.js file is getting very clumsy. I am using express to manage the MVC side of things, but I feel like socket connections don't really fit in the MVC paradigm.
I have read a bunch of tutorials on node JS and socket IO, but all of them have small socket components.
Essentially I am wondering how to break down a large socket.js file into smaller more manageable components? For example, I have a chat room in the page, as well as the game part, and some meta game aspects. I don't feel like these all belong in the same socket.js file, but it doesnt seem clean to divide them in separate files either because you need access to the client and the socket object ( to emit to all users in a room lets say)
Thanks