Coder Social home page Coder Social logo

qur786 / multiroom-pong-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 56 KB

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.

Home Page: https://multiroom-pong-game.onrender.com/

JavaScript 84.91% CSS 11.21% EJS 3.88%
canvas2d expressjs javascript socket-io

multiroom-pong-game's Introduction

Multiroom Pong Game

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.

Technologies Used

  • 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.

Features

  1. Multiplayer Functionality: Players can compete against each other in game rooms.
  2. Real-time Communication: Socket.io enables instant updates of paddle and ball movements between players.
  3. Game Referee: One player assumes the role of the referee, managing the game's score and ball position.
  4. Scoring System: The game ends when one player reaches a maximum score of 5, determining the winner.

Usage

  1. Installation: Clone the repository and install dependencies using yarn install.
  2. Run: Start the server using yarn start.
  3. Access: Visit the application in your browser at http://localhost:3000.
  4. Gameplay: Enter a game room and play against another player.

Project Structure

  • /public: Contains frontend files (EJS, CSS, and JS) for the game interface.
  • /src: Server-side code, including Socket.io logic and game room management.

How It Works

  1. Players join the game, entering a room to play against another participant.
  2. Socket.io enables real-time communication for paddle and ball movements.
  3. The referee manages the game's score and ball position, updating all players via the server.
  4. The game ends when a player reaches the maximum score of 5, declaring the winner.

Contributions

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.

License

This project is licensed under the MIT License.

multiroom-pong-game's People

Contributors

qur786 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.