Skip to content

amilpa/connect-4

Repository files navigation

Connect 4 Multiplayer Game with React and Socket.IO

alt text

Welcome to the Connect 4 Multiplayer Game, a web-based implementation of the classic Connect 4 board game created using React and Socket.IO. This interactive project allows users to host games, invite friends to join with a unique code, change their usernames, and even enjoy rematches. Get ready for hours of fun with friends or players from around the world!

Table of Contents

Demo

A live demo of the game can be accessed here.

Features

  • Multiplayer Gameplay: Play the classic Connect 4 game with friends or players from around the world.

  • Host Games: Users can create and host games, waiting for opponents to join using a unique game code.

  • Join Games: Participants can join games by entering the host's game code, making it easy to connect with friends.

  • Change Username: Customize your in-game username to personalize your gaming experience.

  • Play Again: After completing a game, enjoy the option to start a rematch with the same opponent.

Installation

Follow these steps to run the Connect 4 Multiplayer Game locally:

  1. Clone the repository to your local machine:
    git clone https://github.com/amilpa/connect-4.git
  2. Change to the project directory:
    cd connect-4
  3. Install the project dependencies using pnpm:
    pnpm install
  4. Start the development server
    pnpm start
  5. Access the game in your web browser at http://localhost:5173.

Usage

  • Host a Game: Click the "Host Game" button and share the generated game code with friends. Wait for them to join.

  • Join a Game: Enter a friend's game code and click "Join Game" to become a participant in the game.

  • Change Username: Click on your current username and update it to your preference.

  • Play Again: After a game ends, use the "Play Again" button to start a new game with the same opponent.

Screenshots

Technologies Used

This project was built using the following technologies:

  • React: A JavaScript library for building user interfaces.
  • Socket.IO: A real-time, bidirectional communication library for building interactive web applications.
  • Tailwindcss: A utility-first CSS framework that provides a set of pre-defined CSS classes

Contributing

Contributions to the project are welcome. To contribute, follow these steps:

  • Fork the repository.
  • Create a new branch for your feature: git checkout -b feature-name
  • Commit your changes: git commit -m 'Add feature'
  • Push to the branch: git push origin feature-name
  • Open a Pull Request.

License

This project is licensed under the MIT License.

Enjoy playing Connect 4 with your friends and have fun! If you encounter any issues or have suggestions, feel free to open an issue or contribute to the project. Happy gaming!