Closed nkmlombardi closed 8 years ago
I want to get more modular with the logic inside the server side socket functions (example: startGame, createGame). Each of these functions require pulling a user out of their current Game object and putting them into a new one. That logic can be abstracted out into a separate function that is run in both functions.
I'd also like to move socket emits out of the app.js file, and instead place them on the Object methods. An example of this would be leave a game. The method on the game handles all message broadcasting of the player leaving to other players, this would be helpful because the Object is aware of who is connected to it.
I'll begin doing that on my next commit.
Currently, joining a game does not work. Broken from Angular swap out.
Just realized I need to change everything about how I'm handling objects. Shouldn't be passing around entire objects through function arguments and from the backend to the client side. Should be using references. Seemed like a good idea at first but is realistically very poor design.
Taking advantage of the Angular two way data binding to make adding players and game to lists, appending messages to chat, and logging easier.