This is a Node.js application that hosts a multiplayer Pong game using Express.js and Socket.io. Players can compete in different game rooms, interacting in real-time through the server.
Play the game here: Multiroom Pong Game
❤ Please give it a start if you liked it.
Please note that the project has been deployed in a free tier of a service. Due to resource limitations, players may encounter some delay or lags while playing the game.
- Express.js: Used to set up the server and handle routing.
- Socket.io: Facilitates real-time communication between the server and clients.
- EJS Templates: Renders HTML for the game interface via Express.js.
- Multiplayer Functionality: Players can compete against each other in game rooms.
- Real-time Communication: Socket.io enables instant updates of paddle and ball movements between players.
- Game Referee: One player assumes the role of the referee, managing the game's score and ball position.
- Scoring System: The game ends when one player reaches a maximum score of 5, determining the winner.
- Installation: Clone the repository and install dependencies using
yarn install
. - Run: Start the server using
yarn start
. - Access: Visit the application in your browser at
http://localhost:3000
. - Gameplay: Enter a game room and play against another player.
/public
: Contains frontend files (EJS, CSS, and JS) for the game interface./src
: Server-side code, including Socket.io logic and game room management.
- Players join the game, entering a room to play against another participant.
- Socket.io enables real-time communication for paddle and ball movements.
- The referee manages the game's score and ball position, updating all players via the server.
- The game ends when a player reaches the maximum score of 5, declaring the winner.
Contributions to enhance the game's features or fix issues are welcome! Fork the repository, create a branch, make changes, and submit a pull request.
This project is licensed under the MIT License.