Made with React
This component encompesses the entire app, laying out the route. This route is very simple, containing only '/' and '/game'.
This component is the mainmenu / homepage. This is what the user sees before starting a game.
This component implements the game of checkers itself. Here some noteable functons:
-
receiveMove()- This is a callback function fired by the Socket framework. It will be called whenever a move has been made (by either opponent). -
userJoined()- This is a also callback function fired by the Socket framework. It will be called whenever a user joins the game (including the client).
This component implements the client-side Socket.io framework. Here some noteable functons:
-
subscribeToGame()- This function takes in the callback functionsreceiveMove()anduserJoined()and fires them as indicated above. -
sendMove()- This function emits a message to the Socket component, this contains a string with move data.