Home > other >  how to build LUDO multi player game using mern stack and socket io
how to build LUDO multi player game using mern stack and socket io

Time:11-18

I want to create LUDO game using MERN stack and socket.io . can anyone suggest me how to do this ?

I need guidance that how can I build a game like LUDO

CodePudding user response:

Answer is assuming you want to understand role of various tech for the project.

  1. Create React(for web) or React native (for mobile apps) Project with Socket.IO client library and any other library(component or css).
  2. Create a backend project with express and MongoDB, where express will handle the connections from ReactJS application and all the data (score and game records will be stored in mongodb.)
  3. Socket library will be used to create a full-duplex connection for real-time connection.

React project would basically be a rendering medium of the actual board, that'll be present on the server.

Server will host single or multiple rooms in which players will be able to join and leave, and play the game(moves and all). Each room will maintain it's state (score, turn, win/loose etch).

Each time a player makes a move, event would be emitted from React project and received & processed by the server and then new resultant event will be emitted and that'll be processed by the react client.

This loop of event will continue till the player is in a game or in the app(depending on how you implement it)

  • Related